PeachDrawing.Text
PeachDrawing.Text.Unicode
KhmerCategory Enum
The category a character has in HarfBuzz’s own Khmer shaper: the alphabet its syllable grammar
(KhmerSyllableScanner) is written over and its glyph reorder (KhmerReorderer) acts on.
public enum KhmerCategory : System.Byte
Fields
Other 0
A character that takes no part in Khmer syllable structure: punctuation, another script’s letters, a stray mark this classifier does not assign a dedicated category to. It forms a syllable on its own and is never reordered.
C 1
An ordinary base consonant.
V 2
An independent vowel letter.
H 3
The coeng (KHMER SIGN COENG, U+17D2) - HarfBuzz’s own comment notes “we use
category H for spec category Coeng”. Marks the consonant after it as subjoined/stacked
below (or, for Ra, reordered before the base and given the pre-base-form
pref feature).
ZWNJ 4
A zero-width non-joiner.
ZWJ 5
A zero-width joiner.
Placeholder 6
A placeholder base: a Khmer digit, or KHMER SIGN PHNAEK MUAN (U+17D9).
DottedCircle 7
A dotted circle (U+25CC), the standard stand-in glyph for a mark with no base.
Ra 8
KHMER LETTER RO (U+179A) - the one consonant whose coeng-formed subscript is
reordered before the syllable’s base and takes the pre-base-form pref feature, rather
than staying in place with blwf like every other subjoined consonant.
VAbv 9
A dependent vowel sign written above the base.
VBlw 10
A dependent vowel sign written below the base.
VPre 11
A dependent vowel sign written before the base: the one category
KhmerReorderer moves, to the syllable’s own start.
VPst 12
A dependent vowel sign written after the base.
Robatic 13
A robat (KHMER SIGN ROBAT, U+17CC) or register shifter (Muusikatoan/Triisap,
U+17C9-U+17CA) - absorbed into the base consonant’s own leading unit (HarfBuzz’s own
cn), never reordered.
Xgroup 14
A Khmer sign that groups with the vowel signs ahead of a trailing post-vowel
consonant in the syllable grammar (Nikahit, Bantoc, Toandakhiat, Kakabat..Samyok Sannya,
Viriam - U+17C6, U+17CB, U+17CD-U+17D1) - HarfBuzz’s own Xgroup.
Ygroup 15
A Khmer sign that trails a syllable’s own tail (Reahmuk, Yuukaleapintu, Bathamasat,
Atthacan - U+17C7-U+17C8, U+17D3, U+17DD) - HarfBuzz’s own Ygroup.
Remarks
Khmer categories are not a Unicode property. They are worked out from Indic syllabic/positional
category data plus a small table of Khmer-specific overrides, by Classify(int)
(a direct port of HarfBuzz’s own hb-ot-shaper-khmer.cc/gen-indic-table.py category
derivation - see KhmerCategoryClassifier’s own remarks). Despite sharing
member names with a few of UseCategory’s own (VAbv/VBlw/
VPre/VPst/H), this is a genuinely different, older shaping
model (HarfBuzz’s pre-USE “Indic” shaper, which Khmer and Myanmar still use rather than the
Devanagari-family USE engine) with its own syllable grammar and reorder rules - not an extension of
UseCategory.
Only the categories a Khmer-block (U+1780-U+17FF) codepoint, a dotted circle (U+25CC) or a joiner
(ZWJ/ZWNJ) can ever produce are here - see KhmerCategoryClassifier’s own scope remarks.