在 BeginDoc 前將 EnableFontSubsetting 設為 true 可減少 embedded font data。HotPDF 會對 TrueType fonts 與 OpenType-CFF fonts(name-keyed Latin OTF 與 CID-keyed CJK / Indic / Arabic OTF)進行 subsetting,同時保留 glyph IDs,使既有 Type0 / Identity-H text output 維持有效

THotPDF

 

屬性  FontEmbedding  PDF 篩選器支援

Controls whether embedded fonts are reduced to the glyphs used by the current document.

 

Delphi 語法:

property EnableFontSubsetting: Boolean;

 

C++ 語法:

__property bool EnableFontSubsetting;

 

說明

在 BeginDoc 前將 EnableFontSubsetting 設為 true,可減少 embedded font data。HotPDF 會 subset TrueType fonts 與 OpenType-CFF fonts(包含 name-keyed Latin OTF 與 CID-keyed CJK / Indic / Arabic OTF),同時保留 glyph IDs,使既有 Type0 / Identity-H text output 仍然有效

 

此 property 預設關閉,以保留可能在產生後仍需編輯檔案的 full-font embedding。對於最終 PDF output,啟用 subsetting 可大幅降低檔案大小,尤其是大型 CJK CID-keyed OpenType-CFF fonts(Adobe Fan/Gothic/Heiti/Ming/Myungjo/Song Std、Kozuka Pr6N、Source Han Sans 等),因為每份檔案通常只會使用 18000+ CIDs 中的一小部分

 

寫入 subset font 時,HotPDF 會在 /BaseFont 上使用 PDF 要求的六字母 subset prefix,並讓 embedded font program 在內部與解析出的 PostScript name 保持一致

 

在 PDF/A 下,embedded TrueType subset 會進一步壓縮:保留的 glyphs 會重新編號到 dense range,declared glyph count 會縮減為檔案實際使用的 glyphs,且 CIDFontType2 永遠不會查詢的 GID-indexed tables(cmap、GPOS、GSUB、hdmx、kern)會被移除,並以明確的 /CIDToGIDMap stream 將未變更的 page content 映射到重新編號後的 program;這通常可將 Latin subset 降到幾 KB,而 non-PDF/A output 會保留 glyph-ID-preserving subset,讓檔案仍可編輯/CIDToGIDMap

 

請參閱: FontEmbedding, CFF and OpenType Font Subsetting Functions, PDF 篩選器支援