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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-spec generate (shr_glyph:type()) -> {list(any())}.
generate (Glyph) ->
   {
      [
         {<<"msg">>, <<"add_glyph">>},
         {<<"id">>, shr_glyph:get_id(Glyph)},
         {<<"nam">>, shr_glyph:get_name(Glyph)},
         {<<"omni">>, shr_omnimods:encode(shr_glyph:get_omnimods(Glyph))}
      ]
   }.