-
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
Support (some) Glyphs 3 alternate layers #729
Conversation
pardon my ignorance, what are "Glyphs 3 alternate layers"? Is it a new way to encode 'bracket' layers? |
Sort of. Glyphs 2 bracket layers can specify a "switch point" and be either forwards or reverse - so Glyphs 3 alternate layers do a lot more than that; they directly specify a min and/or a max on each axis. So in G3 you could have a layer that applies The min-max range and multiple-axis cases are going to be very difficult to manage with our current setup; we will need new glyph naming conventions, and will need to tread carefully if we want to prioritise back-conversion from Designspace->glyphs. |
It is documented on https://glyphsapp.com/learn/switching-shapes#g-1-alternate-layers-bracket-layers |
Saira is a good candidate to test this PR (has several simple one-axis bracket layers) and the alternate shape got exported properly :) @anthrotype yes, brace and bracket layers were quite confusing compare to "intermediate" and "alternate", and translation probably complicated. (sorry didn't see previous answer from Simon and Denis) |
Trying this onto another project and I have this error: |
I rounded coordinates of all glyphs and now it works 🤷♀️ sorry for disturbance |
Good to know it works after rounding, but that’s a bug we should fix - it shouldn’t die with an error. |
@RosaWagner I can't reproduce the error you've found. I've tried making alternate layers with unrounded points in the layers, but it still seems to work. I'm going to merge this for now, but I would like to get it fixed. If you can let me look at the project that's failing, maybe I can boil it down to a simple test case. |
Good you merge :) I can't share the sources for this one. But I think it was the translation coordinates of the components that were fractional, not the points themselves. I'll try to reproduce. |
This PR partially addresses #715. Notably, it only deals with alternate layers:
I believe this is all that can be done without serious reworking of how alternate layers are handled by the builders, in particular the way that we name them on export. (It may be possible to have alternate layers on other axes than the first without too much trouble, but I deliberately want to do this in fairly small steps.)
This may be easier to review commit-by-commit as I have done things in small discrete changes