-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error exporting UFO when a GSGlyph contain multiple layers with the same name #566
Comments
i am not sure how we should fix this. If it is a common thing to have multiple layers within the same glyph with the same name, then we should support it somehow without losing data. Otherwise, I'd be inclined to simply warn and only save the last duplicate glyph layer. By the way, before when we were using defcon instead of ufoLib2, we were silently taking the last duplicate-name glyph layer. There is in fact a difference between defcon's and ufoLib2's |
I wouldn’t say it is common but it is possible. e.g. with interpolating 'iColor XX' or 'Color XX' layers. And a 'Color XX' layer might show up twice inside a master.
or
|
I'm inclined to warn and take the last layer. @schriftgestalt the former case is supported because different masters are different UFOs. I guess it's the latter case that blows up. Maybe layer names can be made unique for Glyphs 3? |
is this some special type of layer naming scheme that we should be aware of? |
replying to myself, yes whereas Especially considering that want to support building color fonts (googlefonts/fontmake#30), we do want to make sure we export such layers correctly. Given that UFO layers must have unique names, glyphsLib should make them unique using some suffix when exporting and strip the suffix upon importing. |
the problem here is that the uniqueness of layers in UFO is in their name (layercontents.plist says layer names must be unique), whereas in Glyphs.app it is given by their ID (which is like a uuid). This allows it to have layers with the same name (but different uuid). |
(same error on Noto Sans Georgian from https://github.com/googlefonts/noto-source/blob/809ac0b/src/NotoSansGeorgian-MM.glyphs) |
Fixed with #570 |
Thanks @moyogo and @anthrotype! (happy new year!) |
but why? If the two supplementary layers (both linked to the same master) bear the same "Color XX", couldn't (should) they be flattened into one? What is the purpose of having two with the same name (color)? /cc @schriftgestalt |
oh.. the order is important. Now I understood your example above.
Hm not sure what to do. Could Glyphs.app be chaged so that it ignores any extra characters that appear after the "Color XX" string (where XX are digits)? |
I guess we can do that. |
i'll open a separate issue for this |
when building master UFOs, if a Glyphs's glyph object has more than one supplementary layers with identical name, the builder will attempt to call
ufoLib2.Layer.newGlyph
method twice for the same layer and glyph name, resulting in errors like thisThe text was updated successfully, but these errors were encountered: