Shaping happens on the producer side in HotPDF, driven by the font's own OpenType tables, and the result is emitted with standard PDF text operators. Output is therefore identical in every PDF reader, and copy and paste recovers the original characters because full /ToUnicode reverse mapping is written
The OpenType GSUB Substitution Engine
LookupTypes 1-8 of OpenType GSUB are all implemented (Single, Multiple, Alternate, Ligature, Contextual, Chained Contextual, Extension, Reverse Chained Contextual), together with Script / LangSys selection, GDEF parsing, Cmap format 12 SMP coverage and query helpers such as GetSingleSubstituteGlyph, ApplyLigatureSubstitution, ApplyContextualSubst and ApplyReverseChainedContextualSubst. Every substitute glyph is pulled into the subsetter by MarkUnicodeGlyphUsed, so embedded font subsets remain self-contained
The OpenType GPOS Positioning Engine
All 9 GPOS LookupTypes are covered by the positioning engine: pair, single and contextual kerning in both left-to-right and right-to-left text, mark-to-base, mark-to-mark and per-ligature-component mark-to-ligature placement, cursive entry and exit attachment, distance positioning, and vkrn / vpal vertical kerning for vertical text output
Complex Scripts
More than 20 scripts are shaped through the font's own GSUB feature chain, among them Arabic with its Supplement, Extended-A and Extended-B blocks, Syriac, Mongolian, N'Ko, Adlam, Hanifi Rohingya, Tibetan stacking, Devanagari and the other Indic scripts, Javanese, Thai, Lao, Hebrew, Khmer, Myanmar, Tai Viet and Meetei Mayek. None of them is on by default: each script is an opt-in switch, and existing output stays byte-identical until the switch is thrown
Automatic Shaping Pipeline
Arabic init / medi / fina / isol, rlig, calt, rclt, GPOS cursive attachment, Latin liga / clig and Devanagari reordering are applied whilst text is emitted, through the opt-in ShapingFeatures property and the THPDFShapingFeature enum (sfArabicGSUB, sfCursiveAttachment, sfStandardLigatures, sfContextualLigatures, sfContextualAlternates, sfIndicShaping). The full U+0672-06D5 joining-class table is covered for Arabic as well, with ligature folding for LAM-ALEF, YEH-HAMZA, Allah (U+FDF2) and Bismillah (U+FDFD)
Automatic OpenType Typography
Optional switches apply the font's standard, discretionary and historical ligatures, small capitals, oldstyle, lining, proportional and tabular figures, superscripts, subscripts, ordinals, fractions, scientific inferiors, numerators, denominators, stylistic and contextual alternates, localised forms, case-sensitive forms, slashed zero and vertical alternates, and chained substitutions are resolved back to the source text in the ToUnicode CMap
Synthetic Codepoints and Capability Surfaces
Where a GSUB substitute glyph has no natural Unicode codepoint, Private-Use-Area codepoints (U+E000-F8FF) are allocated by AssignSyntheticCodepointForGID and GetSyntheticCodepointForGID, with mirrored /CIDToGIDMap, /W and /ToUnicode integration. ApplyLatinLigatureRefinement handles Latin ligatures, and callers can drive emission glyph by glyph through GetSyriacJoiningClass, GetMongolianJoiningClass, GetDevanagariCategory, ApplyDevanagariReorder, GetUnicodeGlyphForCodepoint and GetCodepointAdvance
Font Subsetting and CJK PDFs
TrueType, OpenType-CFF, CID-keyed CFF and CFF2 fonts are subset by THotPDF.EnableFontSubsetting, with glyph IDs preserved for Type0 / Identity-H text. CJK documents that used to embed 14 MB CID-keyed CFF programs now ship at 500 KB - 2 MB and lose no rendered glyphs, whilst optional compact TrueType subsets renumber the glyphs that are kept, so a handful of CJK characters costs only a few kilobytes of font data
Variable and Colour Fonts
Before embedding, built-in instancing for TrueType and CFF2 variable fonts bakes TrueType gvar outlines and phantom points, CFF2 blends, mapped axes, and horizontal, vertical and global metrics into a static sfnt with a correct checksum. Colour glyphs are drawn from native COLR v1 paint graphs with gradients, transforms and blend composites, from bounded SVG glyph paths and shapes with fail-closed active-content rejection, and from closest-strike sbix and CBDT/CBLC bitmaps
Compact Font Output
Font programs are always Flate-compressed when embedded, a font that appears on several pages is embedded once for the whole document, and subset tags are derived deterministically from the glyphs actually used so that repeated runs give identical output. Plain-ASCII text with standard fonts can be written as compact unembedded WinAnsi text in an optional mode, and compact subsets, Flate compression and object streams are combined by the single CompressDocument switch