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
| Code | Category | Example codepoints |
|---|---|---|
| 0 | Other | Unassigned / non-syllable codepoints; Khmer punctuation (U+17D4–U+17DC); Khmer Lek Attak numerals (U+17F0–U+17F9) |
| 0 | Other | fallback or outside range |
| 1 | Consonant | Khmer consonants |
| 2 | Independent vowel | Khmer vowel letters |
| 3 | Matra | Khmer dependent vowel signs |
| 4 | Virama | halant or virama |
| 5 | Nukta | nukta mark where the script uses one |
| 6 | Bindu | chandrabindu or anusvara |
| 7 | Visarga | visarga sign |
| 9 | Digit | Khmer digits |
Notes
| MatraPos | Position | Khmer codepoints |
|---|---|---|
| 1 | Pre-base | U+17BE OE, U+17C1 E, U+17C2 AE, U+17C3 AI, U+17C4 OO, U+17C5 AU |
| 2 | Post-base | U+17B6 AA, U+17BF YA, U+17C0 IE |
| 3 | Above-base | U+17B7 I, U+17B8 II, U+17B9 Y, U+17BA YY |
| 4 | Below-base | U+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 category4(virama) so the FSM continues the syllable through stacked-consonant subscripts. The reorder pre-pass keepsCOENG + Consonantpairs together in the base block. - VIRIAM (
U+17D1) is also category4but is functionally distinct fromCOENG: it does not stack a following consonant. The syllable FSM distinguishes the two via the previous codepoint, not the category. - Register shifters (
U+17C9MUUSIKATOAN,U+17CATRIISAP) return category12, sharing routing with other above-base signs. - Consonants and independent vowels (
U+1780–U+17B3) are both category1— 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 category0.
See also
ApplyKhmerReorderApplyIndicReorderGetDevanagariCategoryGetBengaliCategoryGetGujaratiCategoryGetTamilCategoryGetTeluguCategoryGetKannadaCategoryApplyKhmerReorder- Khmer reorder pre-passApplyIndicReorder- Indic dispatcher
Version history
- v2.120.9 - Introduced as part of the HotPDF Indic shaping batch