Introduction
TrueType is a font format that Apple developed and released in 1991; Microsoft adopted it for Windows soon after. It describes each character’s outline with quadratic curves, and carries instructions that adjust the outlines to the pixel grid at small sizes. TrueType fonts work on every desktop operating system and in web browsers.
The same table-based container later became the basis of
OpenType. A
TrueType collection, .ttc, packs several
fonts into one file.
Structure
A TrueType font is a directory of tables, all big-endian. The file starts with an
offset table: the version 00 01 00 00 (Apple fonts may use
true), the number of tables and three values for binary searching. A
16-byte record for each table follows, giving its four-letter tag, checksum, offset and
length. The tables themselves come after, in any order.
0Offset table version, number of tables, search values12 bytes12Table records tag, checksum, offset, length16 bytes each…Tables each at its recorded offsetvaries…head, hhea, maxp global metrics and limitsvaries…cmap maps characters to glyphsvaries…loca, glyf where each outline is, and the outlinesvaries…hmtx, name, post, OS/2 widths, names and morevaries
Links
Software
Developers
- fontTools, Python library that reads, edits and writes TrueType fonts
- FreeType, C library that renders glyphs from TrueType fonts
- opentype.js, JavaScript library that parses and writes TrueType and OpenType fonts
Reference
- TrueType Reference Manual, Apple
- OpenType specification, Microsoft, which also covers TrueType outlines