Knowledge Base

INFO: Calculating the TrueType Checksum

Article ID: 102354

Article Last Modified on 11/21/2006


APPLIES TO


This article was previously published under Q102354
3.10 3.50 3.51 | 4.00 WINDOWS NT | WINDOWS kbgraphic

SUMMARY

To calculate a TrueType checksum:
  1. Sum all the ULONGS in the .ttf file, except the checkSumAdjust field (which contains the calculated checksum). Note that TrueType files are big-endian, while Windows and Windows NT are little-endian, so the bytes must be swapped before they are summed.
  2. Subtract the result from the magic number 0xb1b0afba.

MORE INFORMATION

Example

  1. Open the SYMBOL.ttf distributed with Windows NT. It is 64492 bytes long.
  2. Step through the 16123 ULONGS, summing each one, except for the checkSumAdjust field for the file (which in this case is 0xa7a81151).
  3. Subtract the result from 0xb1b0afba. The result is 0xa7a81151.
The TrueType font file specification is available from several sources: the specifications section of the MSDN library CD or the Microsoft Typography WEB site at:

http://www.microsoft.com/typography


Additional query words: 3.00 3.10 3.50 4.00 5.0 95 98

Keywords: kbinfo KB102354