Skip to content

subsetTtf

subsetTtf(parsed, usedGids): Uint8Array

Defined in: src/core/font/ttf-subset.ts:38

Subset a TrueType font to the glyphs in usedGids (plus their composite components and GID 0). All tables are kept intact so the CIDFontType2 /CIDToGIDMap /Identity contract holds; only glyf/loca are rebuilt, with unused glyphs zero-length.

ParsedTtf

The parsed source font (must have glyf + loca).

Iterable<number>

The glyph ids actually used.

Uint8Array

The subset font bytes.

Error when the font has no glyf/loca (e.g. a CFF/OTF font).