-
Notifications
You must be signed in to change notification settings - Fork 93
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
Keep Glyphs custom parameter does not work #446
Comments
@punchcutter thanks for debugging this. The first is definitely a bug. It should reset the |
see #446 as Zachary noted, 'subset is initialized to None so the first time through thefor loop it is None, but after that it gets set to either True or False and any subsequent iteration doesn't necessarily get to the subset code.' Now it should work (will add tests later).
Ouch.. I just found another issue which is related to this. In glyphsLib 2.2.1 (used by fontmake 1.4), the "Keep Glyphs" instance custom parameter was (used to be) exported with the following UFO lib key:
That's how fontmake itself expects it to be when it goes to However, in the latest glyphsLib 2.3.0, the same "Keep Glyphs" custom parameter is now being exported using this mouthful:
Therefore fontmake cannot see it... The I personally don't like that long name (let alone the space between the words, but that's not the point). Btw, it's not just fontmake that needs to handle the new lib key prefix scheme from glyphsLib 2.3, but also ufo2ft, eg. here: |
Anyway, for now I'll change fontmake to check both the old short name, and the new long one. |
I think glyphsLib should only do Glyphs.app to master UFOs+designspace and not Glyphs.app to master UFOs. That way instance specific parameters can be stored in the designspace instance lib, and be repricated when instance UFOs are generated. We could then get rid of |
Yes, this is a stupidly long name. I'm going to explain how that came to be, so that a better solution can be found:
|
#446 (comment) In glyphsLib 2.3, the 'Keep Glyphs' lib value is not stored with this key: com.schriftgestaltung.customParameter.InstanceDescriptorAsGSInstance.Keep Glyphs We keep supporting both the old and the new, at least until we decide what to do with this mess
After doing some testing on files that use the
Keep Glyphs
custom parameter (Noto Sans Devanagari, Noto Sans Bengali, Noto Sans Kannada, Noto Sans Malayalam) it was clear that nothing at all was happening. I see a couple problems so far.font_project.py
subset is initialized to None so the first time through the for loop it is None, but after that it gets set to either True or False and any subsequent iteration doesn't necessarily get to the subset code. Each ufo needs to be checked for the presence of Keep Glyphs because it could be different for each one. In Noto Sans Bengali all glyphs are set to export so
any(glyph.lib.get(export_key, True) is False for glyph in ufo)
is False and so is(GLYPHS_PREFIX + 'Keep Glyphs') in ufo.lib
because GLYPHS_PREFIX + 'Keep Glyphs' is never set in the ufo in the first place.I adjusted things locally so that everything works, but when it does work we run into another big problem: googlefonts/glyphsLib#205
If Keep Glyphs works and removes the encoded glyphs from the UI instances (because those are replaced with UI specific glyphs) then those codepoints need to be assigned to the UI specific glyphs. Otherwise they just show up as .notdef. That's way worse than the current behavior which is to completely miss the Keep Glyphs which leaves the non-UI glyphs in the UI instances.
The text was updated successfully, but these errors were encountered: