CffSubsetter
in package
FinalYes
Produces a minimal CFF table containing only requested glyphs.
Takes raw CFF table bytes and a set of glyph IDs, and emits a new CFF with only those glyph charstrings and charset entries.
All subroutines (Global + Local) are preserved intact to avoid charstring bytecode analysis. Uses 5-byte integer encoding for offset operands in the Top DICT to guarantee stable sizing.
Table of Contents
Methods
- getGidMap() : array<int, int>
- The old → new GID map from the most recent `subset()` call. Returns an empty array if `subset()` has not been called yet.
- subset() : string
Methods
getGidMap()
The old → new GID map from the most recent `subset()` call. Returns an empty array if `subset()` has not been called yet.
public
getGidMap() : array<int, int>
Return values
array<int, int>subset()
public
subset(string $cffBytes, array<string|int, int> $glyphIds) : string
Parameters
- $cffBytes : string
-
Raw CFF table bytes
- $glyphIds : array<string|int, int>
-
GIDs to keep (GID 0 is always included)
Return values
string —Subset CFF bytes