Showing changes from revision #1 to #2:
Added | Removed | Changed
Size | Value |
---|---|
256 x4 | Hash table of offsets to first kern pair with this hash value |
4 | Offset of end of all pairs |
4 | Font Kern Flags (see below) |
? | Kern pair data (see below) |
The kern pair data is stored consecutively, in hash function order.
Standard Data format | ||
---|---|---|
Word | Bits | Value |
0 | 0-15 | Internal code of first letter of kern pair |
0 | 16-31 | Internal code of second letter of kern pair |
1 | 0-15 | X offset in 1/1000^th^ em |
1 | 16-31 | Y offset in 1/1000^th^ em |
Compressed Data format (bit 31 set) | ||
---|---|---|
Bits | Contents | |
0-7 | First character code | |
8-15 | Second character code | |
16-31 | X or Y offset |
If bit 31 of the flag word is set, then each kern pair is held in 1 word. This can only happen if all kern pairs apply to the first 256 characters, and kerning is only in one direction.
Bit | Meaning when set |
---|---|
1 | No x offset |
2 | No y offset |
31 | Specify short kern pairs |
All other bits reserved |
Kerning information is found by hash table lookup, using the functions:
Value | Function |
---|---|
Hash table index | (first letter) EOR (second letter ROR 4) |
Where the rotate happens in 8 bits.
Note that unlike the rest of the values returned by this call, the kerning information in unscaled, and character codes are internal codes. Font_EnumerateCharacters can be used to map external codes to internal codes.