|
CFF and OpenType Font Subsetting Functions
|
Top EnableFontSubsetting Contents |
|
These unit-level functions expose the public CFF, OpenType-CFF, and sfnt font-inspection surface used by HotPDF's embedded font pipeline. HotPDF also ships reusable Type 1 PFB and CFF parser units for callers that need lower-level font inspection
Delphi syntax function HPDFSubsetCFF(const CFFBytes: TBytes; const KeepGlyph: array of Boolean): TBytes; function HPDFIsCFF2Font(const FontBytes: TBytes): Boolean; function HPDFInstantiateCFF2Font(const FontBytes: TBytes; const AxisValues: THPDFVariableFontAxisValueArray): TBytes; function HPDFSubsetCFF2Font(const FontBytes: TBytes; const KeepGlyph: array of Boolean): TBytes; function HPDFIsTrueTypeVariableFont(const FontBytes: TBytes): Boolean; function HPDFInstantiateTrueTypeVariableFont(const FontBytes: TBytes; const AxisValues: THPDFVariableFontAxisValueArray): TBytes; function HPDFSfntIsOTF(const Data: TBytes): Boolean; function HPDFOTFFindCFFTable(const Data: TBytes; out TableOff: Cardinal; out TableLen: Cardinal): Boolean; function HPDFSubsetOTFContainer(const OTFBytes: TBytes; const KeepGlyph: array of Boolean): TBytes; function HPDFExtractTTFPostScriptName(const Data: TBytes): AnsiString;
Description HPDFSubsetCFF rewrites a CFF font payload in place, preserving glyph IDs and replacing unused CharStrings and subroutines with minimal stubs. This is the helper for callers that already extracted a CFF table from a font container
HPDFIsCFF2Font detects an sfnt with a
HPDFSubsetCFF2Font performs the same default-coordinate instancing whilst replacing unused glyph programs with empty CharStrings. It preserves glyph IDs, multi-FD dictionaries, private hint data, and font matrices
HPDFIsTrueTypeVariableFont detects an sfnt containing
HPDFSfntIsOTF detects an sfnt container whose version is OTTO. HPDFOTFFindCFFTable locates the embedded 'CFF ' table. HPDFSubsetOTFContainer subsets embedded CFF or CFF2 data and returns an OTF container with valid sfnt checksums. HPDFExtractTTFPostScriptName reads name ID 6 from the sfnt
The subsetter recognises both name-keyed CFF (single Private DICT, single Local Subr INDEX) and CID-keyed CFF (Top DICT ROS operator, FDArray of multiple sub-font Private DICTs, FDSelect glyph-to-FD map, per-FD Local Subr INDEXes). CID support covers CJK / Indic / Arabic OpenType-CFF fonts; the closure scan tracks each kept CharString's FD context so per-FD Local Subr INDEXes are independently subsetted
The lower-level CFF integer decoders, FDArray / FDSelect parsers, and subroutine scanners are implementation details behind this public helper surface
Type 1 and CFF parser units
See also: EnableFontSubsetting, FontEmbedding, PDF Filter Support |
The native glyph renderer implements standard Type 2 Boolean, arithmetic, conditional, transient-array and stack operations, including put, get, ifelse, random, dup, exch, index and roll
Transient values reset for each glyph, random values are reproducible, and operand, transient-array, recursion and execution limits reject malformed programs without returning a partial outline
The subset scanner resolves arithmetic and transient-array expressions used by local and global subroutine calls, including Type 2 16.16 fixed-point operands
When random values, unknown transient state or interprocedural stack effects make a call target uncertain, subsetting retains every candidate subroutine rather than dropping a potentially reachable outline dependency
Reserved and deprecated Multiple Master operations remain unsupported and fail explicitly