Each character's Unicode Indic_Syllabic_Category/Indic_Positional_Category drives syllable classification and glyph reordering - the same shaping a browser applies, ported from HarfBuzz's own Universal Shaping Engine.
कि ("ki") - the vowel sign I is a pre-base matra: in the source text it follows the consonant it belongs to, but a real font expects it drawn before the consonant, so the shaped glyph list is reordered accordingly:
कि
cjct) with a pre-base matraक्षि ("kṣi") - the two-consonant conjunct क्ष (KA+VIRAMA+SSA) fuses into a single glyph via the font's own cjct feature, and the following vowel sign still reorders to before the whole fused conjunct:
क्षि
rphf) and repositioningर्कि ("rki") - a word-initial रँ (RA+VIRAMA) forms a reph via the font's own rphf feature, which the shaping engine then moves forward past the base consonant to sit beside the pre-base vowel sign - the font's own pres feature then fuses the repositioned reph with the vowel sign into one combined presentation glyph:
र्कि
कं (anusvara) and कः (visarga) attach after the base without any glyph reordering - only pre-base vowel signs move:
| Anusvara | Visarga | Post-base vowel (contrast) |
|---|---|---|
| कं | कः | का |