|
CFF and OpenType Font Subsetting Functions
|
傳回頂部 EnableFontSubsetting 目錄 |
|
這些 unit-level functions 會暴露 HotPDF embedded font pipeline 使用的公開 CFF、OpenType-CFF 與 sfnt font-inspection surface。HotPDF 也隨附可重複使用的 Type 1 PFB 與 CFF parser units,供需要較低階 font inspection 的呼叫端使用
Delphi 語法 function HPDFSubsetCFF(const CFFBytes: TBytes; const KeepGlyph: array of Boolean): 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;
說明
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
HPDFSubsetCFF2Font performs the same default-coordinate instancing while 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
subsetter 會同時識別 name-keyed CFF(單一 Private DICT、單一 Local Subr INDEX)與 CID-keyed CFF(Top DICT ROS operator、多個 sub-font Private DICT 的 FDArray、FDSelect glyph-to-FD map、per-FD Local Subr INDEXes)。CID 支援涵蓋 CJK / Indic / Arabic OpenType-CFF fonts;closure scan 會追蹤每個保留 CharString 的 FD context,因此 per-FD Local Subr INDEXes 可獨立子集化
較低階的 CFF integer decoders、FDArray / FDSelect parsers 與 subroutine scanners 都是此公開 helper surface 後方的實作細節
Type 1 and CFF parser units
|
原生字形轉譯器實作標準的 Type 2 布林、算術、條件、暫存陣列與堆疊運算,包括 put、get、ifelse、random、dup、exch、index 與 roll
暫存值會在每個字形重設,隨機值可重現,而運算元、暫存陣列、遞迴與執行上限會拒絕格式錯誤的程式,不會回傳不完整的外框
子集掃描器會解析本地與全域子常式呼叫用到的算術與暫存陣列運算式,包括 Type 2 16.16 定點數運算元
當隨機值、未知暫存狀態或跨程序的堆疊效應讓呼叫目標無法確定時,子集化會保留每一個候選子常式,而不是丟掉可能還連得到的外框相依
保留與已棄用的 Multiple Master 運算仍不支援,並會明確失敗