kern subtable length dilemma

Bob Hallissy Bob_Hallissy at sil.org
Thu Jun 27 04:28:31 CEST 2013


Should we document that the USHORT length field of a format 0 kern 
subtable is to be ignored?

In a 2009 presentation 
<http://www.fonttools.org/downloads/TD_2009/OpenType_Status_2009.pdf> at 
DTL FontMaster Conference 2009 Dr. Jürgen Willrodt pointed out that:
> In one of the Vista fonts (Cambria) you can find a kern table with
> one subtable and about 15000 pairs.
> The OT spec however has an entry (unsigned short) for the length of
> the subtable which clearly is not correct because you need 6 byte
> for each kerning pair.
> At least the specification should be updated that this value is
> ignored.

I just did a check in my Windows 7 machine and, sure enough Cambria 
exhibits this condition. As Cambria Regular is a .TTC, I looked at the 
kern table in Cambria Bold:

    Total length of the 'kern' table: 190446 bytes
    Number of subtables: 1
    Details of subtable 0:

        version: 0
        length: 59370  (as declared in the subtable)
        format: 0
        nPairs: 31738

With 31738 pairs, the *actual* subtable length is 6 + 8 + (31738 * 6) 
for a grand total of 190442.  This matches with the total kern table 
length when we add the 4 byte table header.  Interestingly, 190442 
modulo x10000 is, guess what? 59370. So Cambria does the best it can 
when trying to stuff an 18 bit number into a USHORT field.

One might argue that Cambria is in violation of the spec, but I'm 
inclined to agree with them that the fmt 0 subtable length field is 
superfluous and that we should document it as such.

Perhaps this has been discussed before on this or other forums, but I'm 
just now learning about it.
Regards,
Bob








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.aau.at/pipermail/mpeg-otspec/attachments/20130626/eb26f1c1/attachment.html>


More information about the mpeg-otspec mailing list