GetKhmerCategory

Signature

function GetKhmerCategory(CP: Cardinal): Integer;

Purpose

Returns the HotPDF syllabic category used by the Khmer reorder pre-pass. The function is a codepoint lookup, needs no font state, and returns category 0 for values outside the Khmer rangeGetDevanagariCategory et al.)

Return values

CodeCategoryExample codepoints
0OtherUnassigned / non-syllable codepoints; Khmer punctuation (U+17D4–U+17DC); Khmer Lek Attak numerals (U+17F0–U+17F9)
0Otherfallback or outside range
1ConsonantKhmer consonants
2Independent vowelKhmer vowel letters
3MatraKhmer dependent vowel signs
4Viramahalant or virama
5Nuktanukta mark where the script uses one
6Binduchandrabindu or anusvara
7Visargavisarga sign
9DigitKhmer digits

Notes

MatraPosPositionKhmer codepoints
1Pre-baseU+17BE OE, U+17C1 E, U+17C2 AE, U+17C3 AI, U+17C4 OO, U+17C5 AU
2Post-baseU+17B6 AA, U+17BF YA, U+17C0 IE
3Above-baseU+17B7 I, U+17B8 II, U+17B9 Y, U+17BA YY
4Below-baseU+17BB U, U+17BC UU, U+17BD UA

The category values feed the same reorder pipeline used by MatraPos = 5 entries). Vowels whose visual rendering crosses multiple positions (such as U+17BE OE with Top_And_Left, or ApplyKhmerReorder and by the full Indic dispatcher

See also

  • COENG (U+17D2) returns category 4 (virama) so the FSM continues the syllable through stacked-consonant subscripts. The reorder pre-pass keeps COENG + Consonant pairs together in the base block.
  • VIRIAM (U+17D1) is also category 4 but is functionally distinct from COENG: it does not stack a following consonant. The syllable FSM distinguishes the two via the previous codepoint, not the category.
  • Register shifters (U+17C9 MUUSIKATOAN, U+17CA TRIISAP) return category 12, sharing routing with other above-base signs.
  • Consonants and independent vowels (U+1780–U+17B3) are both category 1 — both start a syllable, so bundling simplifies the FSM without affecting reorder output.
  • Khmer Symbols block (U+19E0–U+19FF, lunar date symbols) is out of scope for the Khmer shaper; codepoints in that range return category 0.

See also

Version history

  • v2.120.9 - Introduced as part of the HotPDF Indic shaping batch