-
Notifications
You must be signed in to change notification settings - Fork 449
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
CFF2: interpret empty glyphs from non-default sparse master as missing, like with gvar #3233
Comments
previously we were copying one from the default master, but if this contains cubic curves our own check fails because the .notdef we inserted in the sparse masters OutlineCompiler was not passed through cu2qu... Our intention is to have sparse masters not participate in the interpolation of that particular glyph so we make it empty (gid0=.notdef still needs to be there in a valid TTF so we must have one). Currently the same trick does not work for CFF2 variable fonts (fonttools/fonttools#3233) but those are fine with cubics in .notdef glyph any way.. For now at least
Good news is that it's supposed to work from glancing at the code:
|
We just need to change it to filter out emtpy glyphs as well. I think I can do that. |
well.. it does not as I have shown above. I get an VarLibCFFPointTypeMergeError if I try to pass such a sparse empty glyph setup. That code you linked, _get_cs, returns None if the glyph is not present in a master; here it is present, but empty |
Yeah. We just need to change |
right.. detecting when a charstring is empty is what I couldn't figure it out. Checking its |
in #2082, @justvanrossum added support in varLib for interpreting empty glyphs as missing (thus not participating) if they occur in non-default sparse masters, but this only works for TrueType-flavored VFs:
fonttools/Lib/fontTools/varLib/__init__.py
Lines 320 to 326 in 7fce344
Ideally we would do the same thing for variable CFF2 fonts, but I am not familiar enough with the varLib.cff module to know exactly how/where this change should best be placed.
If one attempts to use this pattern (default master has a non-empty glyph, non-default master has an empty glyph with the same name) one would get the following error:
Maybe @behdad or @justvanrossum can help?
The text was updated successfully, but these errors were encountered: