INFO: Calculating the TrueType Checksum |
Q102354
3.10 3.50 3.51 | 4.00 WINDOWS NT | WINDOWS kbgraphic
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API), used with:
- Microsoft Windows NT Server versions 3.5, 3.51, 4.0
- Microsoft Windows NT Workstation versions 3.5, 3.51, 4.0
- Microsoft Windows 95
SUMMARY
To calculate a TrueType checksum:
- 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.
- Subtract the result from the magic number 0xb1b0afba.
MORE INFORMATION
Example
- Open the SYMBOL.ttf distributed with Windows NT. It is 64492 bytes long.
- Step through the 16123 ULONGS, summing each one, except for the checkSumAdjust field for the file (which in this case is 0xa7a81151).
- 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:
Additional query words: 3.00 3.10 3.50 4.00 5.0 95 98
Keywords : kbOSWinNT350 kbOSWinNT351 kbOSWinNT400 kbSDKWin32 kbOSWin95 kbDSupport
Issue type : kbinfo
Technology : kbAudDeveloper kbWin32sSearch kbWin32API
Last Reviewed: December 16, 2000 |