freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] invalid magic number in TTF


From: Hin-Tak Leung
Subject: Re: [ft-devel] invalid magic number in TTF
Date: Thu, 18 Jul 2013 12:40:33 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 SeaMonkey/2.17.1

Werner LEMBERG wrote:

I only have one issue with freetype 2 at the moment - ftdump (or
ftview) on NISC18030.ttf, one of the fonts shipped with Mac OS X
10.7 (and possibly other versions also) don't work.  I haven't
looked much further, but ghostscript seems to be happy loading the
font file, at least the headers, and I'd be surprised that Apple, of
all people, ships a broken font, so ftdump refuses to do essentially
gs's ttfloadtable is strange.

Apple indeed ships a broken font since it doesn't conform to Apple's
own TrueType standard
(https://developer.apple.com/fonts/TTRefMan/RM06/Chap6head.html): The
`magic number' in the `bhed' table should be 0x5F0F3CF5, however, in
this font it is 0x000000FF.[1]  Actually, this is the first font ever
where I have seen such a problem.  Tsk, tsk, tsk.

I've just changed FreeType so that an incorrect magic number within a
TTF causes a warning instead of an error, and now the font gets loaded
without any problems.


     Werner


[1] The font I have tested is version 6.0d2e1 from 2009, having a size
     of 7108232 bytes.  Interestingly, the `bhed' table has a bad
     checksum, so something has gone wrong while creating the font.
     Additionally, given that the font only contains 16x16 bitmaps, it
     is excessively large: The same data would easily fit into a TTF
     with a size of approx. 1 MByte.

Thanks, Werner. ftdump now works, but ftview still doesn't - a red "Invalid Pixel size" at the top. I am using the stock 2.5.0.1 binaries against mod'ed 2.5.0.1 library patched with just that change.

Mine has the same size from Jul 2011, with md5sum 4eccadbdcfea968e8fa50421600c20ed . Tsk Tsk Tsk indeed, for a font shipped with Apple's own OS.

The font might be "sub-standard", because of its nature/name. I believe it is a government compliance requirement to "have GB18030 support" on any computer system shipped to China (instead of unicode). That it is shipped for government compliance, does not necessarily imply that it is intended to be used. I hear expensive hand-bag manufacturers also care less about the quality of their shipments to China, because the customers just want the expensive name brand and don't care if the seams are coming apart :-(.

Hin-Tak



reply via email to

[Prev in Thread] Current Thread [Next in Thread]