-
Notifications
You must be signed in to change notification settings - Fork 65
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
OTS fails on font with no glyf #52
Comments
That is by design, all zero length tables are rejected (though I can not really tell what issue this check is protecting against). We probably need to relax it a bit, e.g. allow an empty @behdad what do you think? |
I hit that before: https://groups.google.com/forum/#!topic/fonttools/JR1yvwyHj-I I whitelisted empty tables in fonttools: I think we need to test how well this actually works. Worst case, I can change fonttools to write 4 zero bytes if glyf table is empty. |
@rsheeter did you have chance to test if such fonts really work? |
No. Hm; usually our team defines font works as works in browser. Since OTS On Sat, Mar 21, 2015 at 6:52 AM, Khaled Hosny [email protected]
|
@rsheeter See if it works in IE. |
You want to do that by constructing a webfont that maps, say, 'a' to an empty glyph, and see if IE uses the webfont or skips it. |
I tested the font from #52 (comment) (but adding an entry in the So I think fonts with zero-length Closing now, we can probably reconsider this after a couple more years or so when Internet Explorer is no longer relevant (hopefully). |
What if glyf table has 1, or 4, zero bytes? Would that work? If yes, we should make fonttools do that. |
Because right now an innocuous subset operation can generate fonts that will be rejected. |
I need to find how to build such a font. |
Hacking fonttools's _g_l_y_p.py is easiest.
…On Wed, Mar 22, 2017 at 5:07 PM, Khaled Hosny ***@***.***> wrote:
I need to find how to build such a font.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIuK0w8914YhYQDiSt1yIJir0peWolPks5robe0gaJpZM4Dufih>
.
--
behdad
http://behdad.org/
|
Zero-length |
Do we want to also have fontTools add that 1 zero byte when compiling empty glyf tables? |
I guess so, since fonts zero-length glyf table won’t even install on Windows. |
Yes please. |
I found that if I compressed it to woff2, OTS would re-report the error. ttx gistfile1.txt So, shouldn't we give better error alerts to the user before subsetting? This would avoid generating such fonts.
|
It works for the TTF because the glyf table is 1 byte length, while the woff2 it is 0. I guess this issue was never really fixed since ttx never generated a really empty glyf table. |
Using pyftsubset, I cut a font down to just a space character. OTS rejects the font saying:
ot-sanitise /tmp/font.ttf
ERROR: glyf: zero-length table
Failed to sanitise file!
As far as I can tell I can't attach a file to an issue so I put the TTX version of the offending font file in https://gist.github.com/rsheeter/5b692cf56eb5d8d54bfe.
The text was updated successfully, but these errors were encountered: