-
Notifications
You must be signed in to change notification settings - Fork 204
woff2_compress zeroes the glyf OVERLAP_SIMPLE flag #123
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
Comments
I believe this is a limitation of the current WOFF2 format, in that the "tripled encoding" of point coordinates in TrueType glyf table only retains whether each point is an on- or off-curve point (the most significant bit of the flagStream's bytes); the rest of the bits are used for the variable length encoding of point coordinates. |
sorry, I contradicted myself. As I said, the flags can't be stored in current WOFF2. An option could be added to the decoder to set the flags when extracting the compresed WOFF2 font, but not to the encoder itself. The spec needs to be changed if we want to allow storing these OVERLAP flags in the transformed woff2 glyf table. Another option is to leave the glyt table untransformed. I have to check again the spec to confirm whether this is allowed. |
Yes -- according to the WOFF2 spec one can pass-through the glyf and loca tables without any transformation applied by setting their version to "3" (in the bit 6-7 of TableDirectoryEntry.flags):
|
Thanks for this. Do you mean that the flag means: treat glyf data just like an arbitrary unstructured binary table? This wil be more than editing a flag in one of the woff2_compress sources, right? |
yes -- it means the glyf and loca (always go together) tables are stored intact, without transformations applied. The whole font data stream is then compressed with brotli. |
the WOFF2Params struct has an Line 20 in a0d0ed7
however, the |
Hi @anthrotype I ended up running into the same issue and set |
i'm not sure actually. Maybe @rsheeter knows? |
I bumped onto this issue just today, when trying to use the Inter font hosted by Google Fonts. |
Relevant filed issue in Google Fonts repo issues: google/fonts#2602 |
In tests, woff2_compress zeroes the glyf OVERLAP_SIMPLE flag.
This bug refers to the Apple OVERLAP_SIMPLE flag, which is set by default by fontTools varLib.mutator since #1518.
Before woff2_compress:
After woff2_compress:
The text was updated successfully, but these errors were encountered: