freetype-devel
[Top][All Lists]
Advanced

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

[Devel] validation of TrueType fonts, particularly embedded Type 42 font


From: Graham Asher
Subject: [Devel] validation of TrueType fonts, particularly embedded Type 42 fonts
Date: Thu, 11 Jul 2002 19:58:42 +0100

The first twelve bytes of a TrueType font are read by TT_Load_SFNT_HeaderRec
and placed in a SFNT_HeaderRec object. As the comment to
TT_Load_SFNT_HeaderRec says, "'The header will be checked whether it is
valid by looking at the values of `search_range', `entry_selector', and
`range_shift'".

I wonder if this validation can be changed or relaxed in some way - the
values of search_range, entry_selector and range_shift can be calculated
from the other values, as indicated in the comment to SFNT_HeaderRec. The
reason this might be useful is that one of the embedded Type 42 fonts I have
tried out in the GhostScript-FreeType bridge I am writing has completely
incorrect values for the three fields, and yet I am sure it is a valid font.

The first 4 bytes have to be the value 0x00010000 or the bytes 'true'. The
table directory has to contain certain required table tags. Perhaps we could
check these things and just calculate search_range, entry_selector and
range_shift.

I shall experiment with this. In the mean time I would be grateful for
anybody's opinion.

Thanks in advance,

Graham Asher





reply via email to

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