FontForge Maximum Kerning Pairs Limit

This article explores the kerning pair capacity of FontForge, detailing how the software handles pair limits internally and when exporting to standard font formats. While FontForge itself does not impose a strict hardcoded maximum on kerning pairs within its native format, practical limits are dictated by the target font formats—namely OpenType (GPOS) and legacy TrueType (kern) tables.

Internal FontForge Capacity

Within FontForge's native Spline Font Database (.sfd) format, kerning pairs are stored dynamically in memory. There is no predetermined arbitrary ceiling such as 5,000 or 10,000 pairs. The software can theoretically handle hundreds of thousands of kerning pairs during the design phase, limited strictly by your computer’s available RAM and processing power.

Legacy TrueType Kern Table Limits

When exporting a font that utilizes the legacy flat 'kern' table (Format 0), a strict architectural limit applies:

  • Maximum Capacity: 10,920 kerning pairs per subtable.
  • The Constraint: The legacy table format uses a 16-bit unsigned integer to record the subtable length (maximum of 65,535 bytes). With a 14-byte subtable header and each individual kerning pair occupying 6 bytes, the mathematical ceiling is (65,536 - 14) / 6 = 10,920 pairs. Exceeding this amount in a single legacy subtable causes data truncation or generation errors.

OpenType GPOS Limits

Modern fonts utilize the OpenType 'GPOS' (Glyph Positioning) table to handle kerning rather than the legacy table.

  • Subtable Limit: Like the legacy table, individual GPOS subtables are constrained by 16-bit offsets to a maximum size of 64 KB.
  • Multiple Subtables: Unlike basic TrueType tables, FontForge can automatically split pair-by-pair kerning data across multiple GPOS subtables during generation. This allows fonts to technically contain tens of thousands of individual kerning pairs.
  • Class-Based Kerning: FontForge strongly favors class-based kerning for large sets. By grouping glyphs with identical spacing into classes (such as matching all accented variants to a base letter), millions of potential visual combinations can be compressed into a few hundred bytes, bypassing standard file size and subtable constraints entirely.

In summary, while FontForge allows virtually unlimited kerning definitions in design mode, practical export limits dictate a maximum of 10,920 pairs for legacy 'kern' tables, while modern OpenType exports can scale significantly higher via automatic GPOS subtable division and class-based kerning.