THotPDF Indic Reorder and GSUB Shaping Methods

THotPDF API reference

 

THotPDF Methods  Auto Shaping  GSUB

Documents the Indic reorder and GSUB shaping surface, including the per-script reorder helpers, the dispatcher, and the v2.167 Indic GSUB producer path

 

Delphi syntax

function ApplyIndicReorder(const Wide: UnicodeString): UnicodeString; overload;

function ApplyIndicReorder(const Wide: UnicodeString; const Features: THPDFShapingFeatures): UnicodeString; overload;

function ApplyIndicShaping(const S: UnicodeString): UnicodeString;

function IndicShapeToGIDs(const S: UnicodeString): TGSUBLookupArray;

function ApplyDevanagariReorder(const Wide: UnicodeString): UnicodeString;

function ApplyBengaliReorder(const Wide: UnicodeString): UnicodeString;

function ApplyGujaratiReorder(const Wide: UnicodeString): UnicodeString;

function ApplyTamilReorder(const Wide: UnicodeString): UnicodeString;

function ApplyTeluguReorder(const Wide: UnicodeString): UnicodeString;

function ApplyKannadaReorder(const Wide: UnicodeString): UnicodeString;

function ApplyMalayalamReorder(const Wide: UnicodeString): UnicodeString;

function ApplySinhalaReorder(const Wide: UnicodeString): UnicodeString;

function ApplyKhmerReorder(const Wide: UnicodeString): UnicodeString;

function ApplyMyanmarReorder(const Wide: UnicodeString): UnicodeString;

 

Covered APIs

APIUsage notes
ApplyIndicReorderDispatches script-specific Indic reorder helpers before GSUB shaping or text output. The parameterless form keeps full-script coverage; the overload taking a THPDFShapingFeatures set reorders only the scripts whose shaping flag is present, matching the per-flag isolation applied during text output
ApplyIndicShapingApplies reorder plus the Indic GSUB feature chain and returns synthetic-codepoint text for output
IndicShapeToGIDsReturns the shaped glyph-ID sequence for an Indic string without emitting PDF text
ApplyDevanagariReorderApplies the Devanagari syllable reorder pre-pass before cmap and GSUB lookup
ApplyBengaliReorderApplies the Bengali syllable reorder pre-pass before cmap and GSUB lookup
ApplyGujaratiReorderApplies the Gujarati syllable reorder pre-pass before cmap and GSUB lookup
ApplyTamilReorderApplies the Tamil syllable reorder pre-pass before cmap and GSUB lookup
ApplyTeluguReorderApplies the Telugu syllable reorder pre-pass before cmap and GSUB lookup
ApplyKannadaReorderApplies the Kannada syllable reorder pre-pass before cmap and GSUB lookup
ApplyMalayalamReorderApplies the Malayalam syllable reorder pre-pass before cmap and GSUB lookup
ApplySinhalaReorderApplies the Sinhala syllable reorder pre-pass before cmap and GSUB lookup
ApplyKhmerReorderApplies the Khmer syllable reorder pre-pass before cmap and GSUB lookup
ApplyMyanmarReorderApplies the Myanmar syllable reorder pre-pass before cmap and GSUB lookup
GetDevanagariCategoryClassifies Devanagari codepoints for syllable and reorder decisions
GetBengaliCategoryClassifies Bengali codepoints for Indic reorder decisions
GetGujaratiCategoryClassifies Gujarati codepoints for Indic reorder decisions
GetTamilCategoryClassifies Tamil codepoints for Indic reorder decisions
GetTeluguCategoryClassifies Telugu codepoints for Indic reorder decisions
GetKannadaCategoryClassifies Kannada codepoints for Indic reorder decisions
GetMalayalamCategoryClassifies Malayalam codepoints for Indic reorder decisions
GetSinhalaCategoryClassifies Sinhala codepoints for Indic reorder decisions
GetKhmerCategoryClassifies Khmer codepoints for the shared complex-script reorder path
GetMyanmarCategoryClassifies Myanmar codepoints for the shared complex-script reorder path
sfIndicShapingRuns the conservative Indic syllable reorder path before text output without forcing full GSUB feature application
sfIndicGSUBRuns the Indic reorder and GSUB feature chain, then emits shaped glyph IDs through synthetic codepoints

 

Usage notes

sfIndicShaping performs reorder-only output and remains the conservative option. sfIndicGSUB reorders each syllable, applies the OpenType Indic feature chain, emits shaped GIDs through synthetic codepoints, and degrades to the reorder path when the font lacks the relevant GSUB script

Sinhala diga kombuva (U+0DDA) places kombuva before the base and its second component after the base. The GSUB path uses the font's dedicated post-base form when available. Precomposed and canonically decomposed input follow the same placement rules

Bengali reph follows below-base vowels and precedes right-hand vowels, including the right component of split vowels. Gujarati reph follows above-base vowels and precedes below-base and right-hand vowels

For Telugu and Sinhala, the reorder path recognizes reph only when syllable-initial Ra and halant are followed by ZWJ and a consonant. The GSUB path also requires a matching font substitution and preserves ordinary conjunct order when the font lacks one

The Indic GSUB path limits reph substitution to the syllable's initial reph sequence, half forms to eligible pre-base glyphs, and post-base forms to the post-base region. Contextual substitutions respect the same positions, and inserted glyphs inherit the position of the glyph they replace

 

See also: International Script Shaping ShapingFeatures GSUB lookup methods