-
Notifications
You must be signed in to change notification settings - Fork 448
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
Roundtripping Oswald Light crashes Silverlight plugin #372
Comments
roundtripping the Oswald font in TTX only fixes some glyphs bounding boxes and sets a corresponding flag in the head table, but I don't think this is the cause of the problem. I don't know how to test the silverlight plugin with the font... |
My gut feeling: it has to do with TTFAUTOHINT in combination with TTX? I will make a mini git repo for it as soon as I can |
I added a test project to reproduce the issue here. Please feel free to ask any questions if you have troubles with it. |
@ziriax thanks for setting that test repository. In issue #335, the font was Amatic, while here it's Oswald. Both were produced using FontForge, and both had one empty (i.e. containing no lookups) OpenType Layout table: in Amatic, it was the GPOS, in Oswald the GSUB.
I'm tempted to say again that this is a Windows/Silverlight bug. |
I wonder if there's any requirement written somewhere to always have both the GSUB and GPOS tables as a pair, even if one of the two doesn't contain any lookups... I also noticed that a truly empty GSUB table, i.e. also stripped of the ScriptRecords, will not be rejected by Windows 7 Font Preview when roundtripped with TTX. <GSUB>
<Version value="1.0"/>
<ScriptList>
<!-- ScriptCount=0 -->
</ScriptList>
<FeatureList>
<!-- FeatureCount=0 -->
</FeatureList>
<LookupList>
<!-- LookupCount=0 -->
</LookupList>
</GSUB> |
IIRC, Uniscribe requires both GSUB and GPOS to be present, so that is probably why FontForge is generating an empty table. |
Ah, thanks Khaled! |
I don’t know really, it is just some vague recollection. One needs to just test this and see what works with Uniscribe (or try to dig up FontForge sources, but the former might be simpler). |
Maybe related to: |
I found an old post on the FontForge-devel list by George Williams: http://sourceforge.net/p/fontforge/mailman/message/4909509/ In 2005 he submitted a patch to work around a Uniscribe bug whereby some Hebrew GPOS mark-to-base would only work if the font also contained a (possibly empty) GSUB table with a entry for script 'hebr'. Williams quotes a reply by Sergey Malkin (Microsoft) on the OpenType mailing list:
So it seems like the safest approach with Uniscribe would be to always have both tables, with all the same scripts referenced in both. Anyway, the problems still remains as to the way fontTools re-compiles these almost-empty GSUB/GPOS tables (which have no features/lookups but do contain some script records). After roundtripping them with TTX, the fonts can't be even rendered by some windows 7 apps (such as the built-in Font Preview), let alone shaping.. |
@ziriax you beat me! |
LOL! No no, all credits go to Google's search engine :-) |
This should be fixed now. Please reopen if it's not. @rsheeter @garretrieger We might need to recut a few Google Fons... |
That was quick! |
Humm. Ok, let me give that one a try as well. |
basically, we need to replicate byte-to-byte the way FontForge or MS Volt compiles these semi-empty tables, otherwise Windows 7 won't be happy. You can grab Oswald-Light from here: If try to roundtrip the font with ttx, you'll notice that the size of GSUB shrinks from 80 bytes in the original to 48 bytes in fonttools. If you have a Windows 7 machine at hand, you'll see that Windows font preview will refuse to show the roundtripped font, whereas it loads the original just fine. It appears that only the GDI renderer is broken. In fact, if you install the font in C:\Windows\Fonts and load it, say, with the latest MS Word (which uses DirectWrite), the rountripped font will still work. I also tested on Windows 8, and the bug seems to be resolved there. |
Can you try again? |
I roundtripped Oswald-Light.ttf with ttx and now it works in Windows 7! |
Excellent! |
this was really a weird bug! |
Thanks Behdad! |
I noticed that the Oswald Light font from Google Fonts crashes the Silverlight plugin.
When using the font version from http://www.fontsquirrel.com/fonts/oswald, it works fine.
When roundtripping the fontsquirrel font using TTX, Silverlight crashed again.
The text was updated successfully, but these errors were encountered: