Naming and encoding glyph challenges

I am finding it increasingly difficult to work on legacy data where we need to preserve existing glyph names which Glyphs thinks should have a different Unicode than I want in my data. The fundamental issue is that will sometimes try to map 2 glyphs to a single Unicode, which is illegal in the OT spec. A Glyphs source should never have two glyphs with the same code. If any automatic process tries to encode a glyph, it should first check to see if that code already exists, and if it does, the action should be stopped. Raise a dialog at this point rather than wait until generating an OTF or TTF fails.

I’ve seen situations where I tried to create a new glyph named uni0326, since I have an unencoded glyph named commaaccent already present. When I try to add the glyph, it creates something named commaaccent.001. This is an example of Glyphs attempting to “help” me, which isn’t very helpful. Related to this, I just tried creating a bunch of localized glyphs based on the proposed scheme of adding .loclTAG_, and instead it named these glyphs with .001.

What version do you have the duplicate unicode problem on export? I don’t add unicodes on export. There was a problem with makeOTF that would automatically assign unicodes to a predefined list of glyphs (e.g. uniXXXX names and some AGLFN glyphs). I fixed that some time ago.

What glyph combination did trigger the problem at export?

I fixed the renaming of the uni0326 glyphs.

The .loclTAG should not have a underscore at the end. How did you add the locl glyphs? I can’t reproduce this problem.

This export problem is still happening in V2, 689, but I think the issue is that the Glyphs file got into a corrupt state somehow. I have cases where two different glyphs have the same name, or Unicode, or BOTH! That should not be possible.

I fixed the renaming of the uni0326 glyphs.

Is the fix specific to this glyph name? We need a general fix, where:

  1. No two glyphs can have the same name.
  2. No two glyphs can have the same Unicode.
  3. Adding a glyph with a name that is in the GlyphData.xml should not blindly encode the glyph according to GlyphData.xml.
  4. If we try to name or encode a glyph with a name/code that already exists, Glyphs should just raise a notification dialog stating that the key already exists.

The .loclTAG should not have a underscore at the end. How did you add the locl glyphs? I can’t reproduce this problem.

Interesting. I just used the Add Glyphs menu item. When I changed the suffix from .loclNAV_ to .locl_NAV, the glyph naming actually worked. But the auto locl feature does not generate substitution as expected.

No. Before, if you add a glyph with the generate glyphs dialog, it would not check the "Use custom naming" option. This is fixed now.

There is no hard technical limit that prevents duplicate names or unicodes. I try to check at all possible places but you will always find a way to sneak in some duplicates.
Could you send me the corrupt file?

It should be only .loclNAV no underscore whatsoever.