ApplyKhmerReorder
Signature
function ApplyKhmerReorder(const Wide: UnicodeString): UnicodeString;
Purpose
Applies the Khmer reorder pre-pass to Wide and returns a UnicodeString prepared for cmap and GSUB consumption. Text outside Khmer remains byte-stable, so callers can route mixed text without changing unrelated runs
Coverage
- Khmer uses the
khmrscript record for U+1780-U+17FF. The documented path covers independent South-East Asian syllable processing while preserving API behaviour for producer-side shaping ApplyIndicReorderdispatches to this helper when the active codepoint range matches U+1780-U+17FF
Example
var
Wide: UnicodeString;
begin
// Input: KA (U+1780) + E-vowel (U+17C1, pre-base)
Wide:= Doc.ApplyKhmerReorder(#$1780#$17C1);
// Wide is now: E (U+17C1) + KA (U+1780)
// Input: KA + COENG + KHA + AA-vowel (stacked consonant + post vowel)
Wide:= Doc.ApplyKhmerReorder(#$1780#$17D2#$1781#$17B6);
// Wide unchanged: KA + COENG + KHA + AA
// (COENG cluster stays in BaseBuf in original order; AA in PostBuf)
end;
See also
ApplyIndicReorder- coverageGetKhmerCategory- Khmer category lookup
Standards
- Unicode 16.0 U+1780-U+17FF
- ISO 32000-1 ยง9.10
- OpenType Khmer shaping specification
Version history
- v2.120.9 - Introduced as part of the HotPDF Indic shaping batch