[OpenFontLibrary] Using OTS to detect a "buggy" web font
Paul Flo Williams
paul at frixxon.co.uk
Sun Jun 5 06:41:35 PDT 2011
[Reposted here at Christopher's suggestion]
My first upload to the reborn Open Font Library was Segment14, and it
failed badly as a web font in Firefox 3.6.17 on Fedora, not displaying at
Christopher Adams confirmed that it worked on the WebKit-based browsers
Safari and Midori, and it works on my HTC Desire.
After some minor, unrelated, cleanups, FontForge gave both the SFD and OTF
files a clean bill of health, but it still wasnt working in Firefox, so I
took a deeper look and found that Mozilla had added the OTS font
sanitizing library to Firefox from version 3.6.13, back in December 2010.
OTS is mainly designed to be added as a font condom for OpenType-consuming
applications, as Firefox apply it, but it also has a standalone checker
called ot-serialize. OTS isnt packaged in Fedora yet, so I collected it
from upstream and ran it over my font, with these results:
ERROR at /home/paul/projects/ots/ots-read-only/src/cff.cc:377
(bool::ParsePrivateDictData(const uint8_t*, size_t, size_t, size_t,
Ugly. Still, its a yes/no tool, so Im prepared to do a little hunting
through the source to find out exactly why it hates me.
The answer is that my FontForge source had a definition of BlueValues in
the Type 1 Private dictionary. I dont remember how it got there, because
it is optional, but I had put one in, and I had defined it as an empty
array. OTS decided that, if arrays exist in the Private dictionary, they
must not be empty. With a quick snip, my font works again.
Ill certainly be adding OTS to my fonty toolchain, and it strikes me that
this would be a useful tool for packaging and using in font reviews. You
wouldnt want to fail a review because of it, but it would certainly help
to know whether a font will fail on the Web, which must be a large part of
users expectations now.
P.S. Christopher Adams has now opened a blueprint to add this to the Open
Font Library toolchain.
Paul Flo Williams
More information about the OpenFontLibrary