INFO: Calculating the TrueType Checksum (102354)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • Microsoft Windows NT Server 3.5
    • Microsoft Windows NT Server 3.51
    • Microsoft Windows NT Server 4.0
    • Microsoft Windows NT Workstation 3.5
    • Microsoft Windows NT Workstation 3.51
    • Microsoft Windows NT Workstation 4.0
    • Microsoft Windows 95

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


Modification Type:MinorLast Reviewed:3/7/2005
Keywords:kbinfo KB102354