THotPDF.EnableFontSubsetting

THotPDF

 

Properties  FontEmbedding  PDF Filter Support

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

 

Delphi syntax:

property EnableFontSubsetting: Boolean;

 

C++ syntax:

__property bool EnableFontSubsetting;

 

Description

Set EnableFontSubsetting to true before BeginDoc to reduce embedded font data. HotPDF subsets TrueType fonts and OpenType-CFF fonts (both name-keyed Latin OTF and CID-keyed CJK / Indic / Arabic OTF) while preserving glyph IDs so existing Type0 / Identity-H text output remains valid.

 

The property is off by default to preserve full-font embedding for documents that may be edited after generation. For final PDF output, enabling subsetting can greatly reduce file size - especially for large CJK CID-keyed OpenType-CFF fonts (Adobe Fan/Gothic/Heiti/Ming/Myungjo/Song Std, Kozuka Pr6N, Source Han Sans, etc.) where only a small fraction of the 18000+ CIDs is typically used per document.

 

When a subset font is written, HotPDF uses the PDF-required six-letter subset prefix on /BaseFont and keeps the embedded font program internally consistent with the resolved PostScript name.

 

Under PDF/A the embedded TrueType subset is compacted further: the kept glyphs are renumbered into a dense range, the declared glyph count is reduced to the glyphs the document actually uses, and the GID-indexed tables a CIDFontType2 never consults (cmap, GPOS, GSUB, hdmx, kern) are dropped, with an explicit /CIDToGIDMap stream mapping the unchanged page content onto the renumbered program - this routinely takes a Latin subset down to a few kilobytes, while non-PDF/A output keeps the glyph-ID-preserving subset so the file stays editable

 

See also: FontEmbedding, CFF and OpenType Font Subsetting Functions, PDF Filter Support