How Modulo-2^32 SFNT Table Checksums and 0xB1B0AFBA Work
Computing Per-Table Sums and head.checkSumAdjustment
Every table record in an OpenType or TrueType font stores a 32-bit unsigned big-endian checkSum calculated by summing sequential 32-bit big-endian words across the zero-padded table bytes modulo 2^32. One special exception applies to the head table: bytes 8..11 store checkSumAdjustment, which must be masked to 0x00000000 while computing head’s own directory checksum.
Once the Offset Table, sorted Table Directory, and all padded tables are assembled, the encoder sums every 32-bit word of the entire file (again with head[8..11] zeroed) and writes (0xB1B0AFBA - wholeFontSum) mod 2^32 into head.checkSumAdjustment. Consequently, summing a valid desktop font file from byte 0 to EOF yields exactly 0xB1B0AFBA.
- Audits required core tables (cmap, head, hhea, hmtx, maxp, name, OS/2, post) plus outline tables.
- Flags out-of-bounds offsets or overlapping table slices before desktop installation.
- Displays side-by-side declared vs recomputed hex checksums for every table.
- Exports normalized SFNT binaries when unpacking compressed WOFF or WOFF2 sources.