Introduction
OpenType is a font format developed by Microsoft and Adobe in the late 1990s and standardised as the Open Font Format, ISO/IEC 14496-22. It extends the TrueType container with Adobe’s PostScript outlines, in a table called CFF, and with layout tables that hold typographic features such as ligatures, small capitals, kerning and the shaping rules complex scripts need. Variable fonts, which hold a whole range of weights or widths in one file, are also OpenType.
A font with PostScript outlines usually has the extension .otf; an
OpenType font with TrueType outlines usually keeps .ttf.
Structure
An OpenType font uses the same table directory as TrueType: an offset table, a
16-byte record per table, then the tables, all big-endian. A font with PostScript
outlines starts with the version tag OTTO and stores its glyphs in a
CFF or CFF2 table instead of glyf and
loca. The layout features live in GSUB (glyph substitution),
GPOS (glyph positioning) and GDEF, and variable fonts add
tables such as fvar for their axes.
0Offset tableOTTO, number of tables, search values12 bytes12Table records tag, checksum, offset, length16 bytes each…Tables each at its recorded offsetvaries…head, hhea, maxp, cmap, name, OS/2varies…CFF or CFF2 PostScript outlinesvaries…GSUB, GPOS, GDEF typographic featuresvaries…fvar and related tables, in variable fontsoptional
Links
Software
Developers
- fontTools, Python library that reads, edits and writes OpenType fonts
- FreeType, C library that renders glyphs from OpenType and TrueType fonts
- HarfBuzz, C++ text shaping library that applies OpenType layout features
- opentype.js, JavaScript library that parses and writes OpenType fonts
Reference
- OpenType specification, Microsoft