[mpeg-OTspec] kern subtable length dilemma

Adam Twardoch (List) list.adam at twardoch.com
Thu Jun 27 15:16:06 CEST 2013


That is bizarre indeed.

Our interpretation at Fontlab Ltd. has always been that a subtable can 
host no more than 10920 pairs (which is the maximum number to fit the 
subtable under 64K).

A.

On 13-06-27 04:28, Bob Hallissy wrote:
>
> 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
>
>
>
>
>
>
>
>
> 


-- 

May success attend your efforts,
-- Adam Twardoch
(Remove "list." from e-mail address to contact me directly.)




More information about the mpeg-otspec mailing list