-
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
difference between "Keep Glyphs" vs "Export Glyphs" custom params? #295
Comments
is the key difference that "regardless of whether the glyph was set to export or not"? because by just reading the description of "Keep Glyphs" it's definitely not clear the connection with the glyph "export" flag... |
and do we need to support that "Export Glyphs" somehow? (I wonder why one needs three ways to specify a font's subset) |
The .exports key is ignored when the glyph is mentioned in a ‘Keep Glyphs’ parameter. |
wait.. you actually mean the .exports key is ignored when the glyph is mentioned in Export Glyphs? |
I just had another look. There are two different parameters.
|
great, so the thing fontmake is currently doing is wrong.. because it checks Keep Glyphs and if it's not in there it checks the individual exports flags. so this Export Glyphs is kind of a global override which (for a given font instance) discards the individual glyph exports flags, and makes it so that the glyphs included are exported, but those that aren't will be exported depending on their individual export flag (which is basically fontmake's current algorithm). hm, I'm not sure what to do. |
I think you are doing it right. The There is one more parameter in that group: |
No, this is what fontmake is doing: it first checks if the keep_glyphs list is not empty; then it checks if the glyph name is present in there; if not, it skips the glyph and continues the loop; (so far so good). However, if the keep_glyphs list is either missing or is empty, or it is non-empty and the glyph name is contained in there, fontmake goes on checking the individual glyph exports flag: if the latter is present and set to False, fontmake skips the glyph, despite the global keep_glyphs list said the contrary. this is the code: |
I do is |
So, "Keep Glyphs" overrides everything, then the export flag on a glyph is honored except if the glyph name is in "Export Glyphs" or not honored if it is in "Remove Glyphs"? |
I don't think we need to support all four ways to subset glyphs. It's already complicated like this, with global "Keep Glyphs" and per-glyph "Export" flags. Let's keep it simple |
fontmake currently uses a combination of "com.schriftgestaltung.Glyphs.Export" (bool, inside the GLIF lib) and "com.schriftgestaltung.Keep Glyphs" (list of strings, in the global UFO lib) in order to determine the list of final glyphs to keep in the generated font (currently using the fonttools subsetter after the fact, but I'd like to change this, anyway that's another issue..).
https://github.com/googlei18n/fontmake/blob/6cdf44ea38d17f9bb14fa65c1c9bc6ea82e3b89b/Lib/fontmake/font_project.py#L300-L304
In the Glyphs handbook I see two very similar custom parameters and I can't understand what is the difference between the two.
Can anyone please enlighten me? Thanks
/cc @schriftgestalt @moyogo @belluzj
The text was updated successfully, but these errors were encountered: