Introduction
A TrueType collection packs several TrueType or OpenType fonts into one file, so that they can share tables they have in common. It is used mostly for CJK fonts, where thousands of glyphs can be shared between, for example, a proportional and a fixed-width version of the same typeface, and for system fonts on Windows and macOS that come in several weights.
The OpenType specification now calls it an OpenType font collection and allows any
kind of outlines in it, TrueType, CFF, CFF2 or a mix. Collections with TrueType
outlines should use the extension .ttc, and collections with CFF or CFF2
outlines .otc; the file structure is the same.
Structure
A collection is big-endian. It starts with a
collection header: the tag ttcf,
a version (1.0, or 2.0 which adds three fields for a digital signature), the number of
fonts and a 32-bit offset for each font. Each offset points to an ordinary
table directory, the same as at the
start of a single TrueType or OpenType font, and every table offset in it counts from
the start of the collection file. The table records of different fonts may point to the
same table data, which is how the fonts share glyphs.
0Collection headerttcf, version, number of fonts12 bytes12Offsets one 32-bit offset per font4 bytes each…Signature fields version 2.0 only:DSIGtag, length, offset12 bytes…Table directories one per font12 + 16 bytes per table…Tables shared or belonging to one fontvaries…DSIG the signature, if any, at the very endoptional
The tables themselves are the same as in single fonts; see the TTF pages for TrueType tables and the OTF pages for CFF, layout, colour and variation tables.
Not described
Known, not yet covered
- Viewer: the explorer shows the collection header, each font’s
table directory, which tables fonts share and which bytes no font refers to, and
reports every problem the header and directories can have. The tables of each member
are decoded in the tree with the same decoders as the
.ttfviewer (head, cmap, name, glyf, GSUB, GPOS, the colour, bitmap, variation and Apple tables), so the shared limits listed on the TrueType font page apply to them too. Each member font opens as a font of its own in the.ttfviewer (with the tables it shares resolved), and the Font, Tables, Outlines and Instructions tabs of that viewer, with its variation, colour palette and text shaping options, show the member that the “Font in the collection” option picks. The signature in aDSIGtable is shown but not verified. - Viewer: the variation axes, named instances and colour palettes offered
above the viewer are those of the member the “Font in the collection” option picks: members
with the same options share one set of fields, and a set is shown only while one of its members is
chosen. The offsets and directories of the first 16,384 fonts are read (the checker’s files of 5,000 fonts
and of 3,000 fonts with 70 tables each are read whole), with a budget of 5,000,000 table records for all
the directories of a file (no real collection comes near either limit); fonts past one are stated in a
problem, and the bytes no read font refers to are then not called unreferenced. The signature in a
DSIGtable is not verified (its structure is decoded); a table overlap inside one font is reported once, by that font’s records.
Links
Software
Developers
Reference
- OpenType font file: font collections – Microsoft’s specification of the collection header and table sharing
- DSIG table – the digital signature table a version 2.0 collection can point to