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.
Parameters
Section titled “Parameters”parsed
Section titled “parsed”The parsed source font (must have glyf + loca).
usedGids
Section titled “usedGids”Iterable<number>
The glyph ids actually used.
Returns
Section titled “Returns”Uint8Array
The subset font bytes.
Throws
Section titled “Throws”Error when the font has no glyf/loca (e.g. a CFF/OTF font).