[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Devel] No support for Apple composit glyphs
From: |
George Williams |
Subject: |
[Devel] No support for Apple composit glyphs |
Date: |
Thu, 11 Jul 2002 17:28:41 -0700 |
Back in last October (24-Oct-2001) a bug report of mine appeared on this
list. I would like to correct the original report and offer a patch for the
bug.
I had previously stated that there was no support for MS composite glyphs,
on looking at the code more closely I realize I had it backwards and there
was no support for Apple composite glyphs.
The relevant documents are at:
http://partners.adobe.com/asn/developer/opentype/glyf.html
http://developer.apple.com/fonts/TTRefMan/RM06/Chap6glyf.html
If a component of a composite glyph has a transformation matrix then
(according to Apple) it's offset will be scaled by a complex fomula based
on this matrix, while according to MS the offset is not scaled.
Apple defines a peculiar algorithem for computing the scale factors for the
offset. As best as I can tell this algorithem has little connection to
reality. I've reversed engineered another algorithem which generates a much
closer approximation to what I observe on my Macs' screens.
The OpenType spec provides an extension to disambiguate between Apple's and
MicroSoft's differences (by providing two new bits for the flags array in a
composite glyph-- one for apple, one for ms). Old fonts will set neither
bit and will remain ambiguous.
If anyone wishes to examine these differences themselves, I have posted a
set of test fonts (well, really one font, but formated for different
platforms and with the three possible bit settings: Apple rules, MS rules,
unspecified and thus ambiguous).
http://pfaedit.sf.net/Composites/index.html
Here are two patch files, one to ftoption.h documenting another
configuration define to allow the user to specify the platform default
(ie. in ambiguous cases the rasterizer should follow either Apple's or MS's
rules), the other to src/truetype/ttgload.c which contains the actual code.
I have included both my algorithem, and #ifdeffed out the one Apple
documents (but which does not work).
Hope I haven't strayed too far from freetype's conventions.
I assume it would make sense to have the configuration script (or jam file,
or whatever) set the configuration option if freetype is built on a Mac,
but I shall not even attempt that work.
ttgload.patch
Description: Text document
ftoption.patch
Description: Binary data