-
Notifications
You must be signed in to change notification settings - Fork 51
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
generate intermediate layer name from coordinates when converting to UFO #928
Conversation
3aea758
to
4073e67
Compare
I see two issues here:
I think we need to answer the question of what GlyphsApp API to use for layer names (#851 (comment)) and change the code accordingly. |
#851 has been sitting for too long and it's blocking the build of several fonts. I don't know how to answer those valid questions you raised, I'm just interested in unblocking the glyphs2ufo (and thus build) for intermediate layers in .glyphs v3 sources |
The API issue is a secondary concern to be honest. My main concern is the round tripping since this something I often do, and glyphsLib has gotten better at lately, so it would be a shame to regress here. So for blocking these issues, I think #902 is better. Or we can go ahead and added a getter only |
alright, I'll incorporate that and finish it up. I honestly don't feel like adding that nameUI you suggest, not only because it doesn't match what Glyphs.app currently does, but I have no idea what that's supposed to do with other special kinds of layers, here we are only interested in the intermediate (brace) sort. |
It should handle at least color layers as well (I think we have some custom code to handle them that would be then dropped). The format would match what we parse for Glyphs 2 layer names (e.g. |
are those also broken by the layer.name issue in #851? |
Probably not, since we rename these layers already. glyphsLib/Lib/glyphsLib/builder/layers.py Lines 36 to 38 in dee4e92
I was thinking if we are going to have a central solution, lets handle more cases than handling them all over the place. But feel free to focus on fixing the issue at hand. |
thanks, i will add there the logic for intermediate layer names, right after the color layers |
…ontinues to work as Khaled recommended in #928 (comment)
OK the glyphs->glyphs is not affected by this change, only the glyphs->ufo (and thus ufo->glyphs) but I think it is for good |
I think I have dealt with that in the Glyphs3 branch already. Or at least it will handle that the same way as Glyphs does when I’m done. |
Thanks Georg, good to know. However that branch doesn't seem to be in a mergeable state right now, ideally we would like to hot-fix this issue in |
I’ll see if I can have a look at it in the next couple of days. |
thanks. In the meantime I prefer we release a bugfix with this. |
Fixes #851
currently .glyphs v3 sources containing intermediate ('brace') layers fail to build with fontmake because glyphsLib is generating designspace files with multiple sources at the same location.
glyphsLib uses the
layer.name
to define the name of the UFO layer containing the glyphs at intermediate locations, and for .glyphs v2 sources this was ok; but for .glyphs v3 thelayer.name
for intermediate layers is not what the source file contains at the layer'sname
attribute (usually just the date-time when the layer was first created), but is supposed to be a string generated from the layer's coordinates (as displayed in the Glyphs UI).This PR is an alternative to @kontur's #902 PR, in that it changes the GSLayer.name property getter itself, instead of simply the calling site where the brace/intermediate layers get converted to UFO layers.I believe this is better because:1) printing thelayer.name
for a brace layer from within the Glyphs.app's Macro window will return the generated string, not the underlying original name string (e.g. timestamp), so we'd match that;2) the original layer name can't be edited from the Glyphs.app UI and is not even shown to the user so we can treat it as non-existent and we should not care about roundtripping it back, it's just useless.EDIT: This is essentially the same as @kontur's #902 PR, with some test fix-ups.