-
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 instances with renamed and removed glyphs #127
Conversation
Fixes #126. Will fix googlefonts/fontmake#257 once we cut a new release of glyphsLib and update fontmake's requirements.txt accordingly.
I don’t think glyphs in renamed_glyphs should be removed unless they also are in removed_glyphs. |
"Rename Glyphs" should swap glyphs names. For example renamed_glyphs = {'A': 'A.alt'} means A and A.alt swap names.
and
|
We have to update the names of the components in composite glyphs.
|
I guess the components renaming should be the responsibility of MutatorMath, who is the one actually generating the UFO instances. |
This is super confusing, but it’s the documented behavior of Glyphs.app. #127 (comment) https://glyphsapp.com/content/1-get-started/2-manuals/1-handbook-glyphs-2-0/Glyphs-Handbook-2.3.pdf#page=194
Changed rename to swap. Have another look? Regarding composites, is the current output (after this change) enough for MutatorMath to eventually do the right thing? |
That looks correct. In Glyphs, if two base glyph names are swapped with “Rename Glyphs”, the composite glyphs still point to the old base glyphs that have a new name. For example if
But if there is also
MutatorMath doesn’t do anything to composite glyphs if base glyph names are swapped, because it has a completely different semantics. Instead of renaming, it replaces the glyph with another from a |
I edited my last comment: “it replaces the glyph with another from a |
So this approach probably won’t work, and instead we’ll need to post-process the interpolated instance UFOs? |
This is all very confusing, I need more time to understand how mutatormath is supposed to work in this case. I will have another look tomorrow. Before I forget, I noticed that "muted" glyphs in mutatorMath do not propagate to composite glyphs which reference them. I think we want them to be decomposed. It seems a known limitation: https://github.com/LettError/MutatorMath/blob/master/Lib/mutatorMath/ufo/instance.py#L402-L404 |
The Rename Glyphs parameter also switches the export bit and a manually set production name. |
Looking at other parameters that can be set for an instance, it looks like we’ll eventually need to post-process the MutatorMath output anyway by rewriting instance UFOs. From that perspective, it might be easier to run the full font through MutatorMath (as today) and instead swap and remove glyphs in UFO, where it’s probably easier to implement the same semantics as Glyphs. Personally, however, I’d like to focus on variation fonts, so I probably won’t be able to spend a ton of time on perfecting instance generation. |
Wouldn't it be easier to implement the glyph swap/removal at the level of the TTFont instance, rather than in the UFO? |
There might be value in a reasonably good Glyphs → UFO conversion outside of fontmake? Not a strong opinion though. Anyhow, it looks like the approach from my pull request won’t work with composite glyphs. So I guess the pull request should be closed without merging. |
Fixes #126.
Will fix googlefonts/fontmake#257 once we cut a new
release of glyphsLib and update fontmake's requirements.txt accordingly.