ApplyGujaratiReorder
Signature
function ApplyGujaratiReorder(const Wide: UnicodeString): UnicodeString;
Purpose
Applies the Gujarati reorder pre-pass to Wide and returns
the reordered UnicodeString ready for cmap + GSUB consumption.
Non-Gujarati content passes through byte-identical.
Reorder rules applied
- R1 Repha:
Ra (U+0AB0) + Halant (U+0ACD) + Consonant→ (Ra, Halant) moves to syllable end. - R2 Pre-base matras:
U+0ABFI moves to syllable start. - R3 Above-base matras:
U+0AC5CANDRA E,U+0AC7E,U+0AC8AI emit after the base block. Note Gujarati E/AI are above-base (like Devanagari), unlike Bengali where they are pre-base. - R4 Below-base matras:
U+0AC1–U+0AC4U/UU/Vocalic R/RR,U+0AE2–U+0AE3Vocalic L/LL emit after above-base. - R5 Post-base matras:
U+0ABEAA,U+0AC0II,U+0AC9CANDRA O,U+0ACB–U+0ACCO/AU emit after below-base. - No split matras in the Gujarati main block.
Output layout per syllable: [pre-matras] + [base + halant + nukta + bindu/visarga/modifier] + [above-matras] + [below-matras] + [post-matras] + [Repha: Ra Halant]?
Conjuncts (C + Halant + C) preserved in the base block.
Single-pass and idempotent.
Example
var
Wide: UnicodeString;
begin
// Input: KA + AA(post) + U(below) + E(above) + I(pre)
Wide:= Doc.ApplyGujaratiReorder(#$0A95#$0ABE#$0AC1#$0AC7#$0ABF);
// Wide is now: I + KA + E + U + AA (canonical 5-buffer order)
end;
See also
ApplyIndicReorder— total dispatcher.ApplyDevanagariReorder— Devanagari counterpart.ApplyBengaliReorder— Bengali counterpart.GetGujaratiCategory— Unicode codepoint → category lookup.
Standards
- Unicode 16.0 §12.6 (Gujarati)
- Unicode 16.0
IndicSyllabicCategory.txtandIndicPositionalCategory.txt - ISO 32000-1 §9.10 (extraction of text content)
- OpenType Gujarati shaping spec
Version history
- v2.119.72 — Introduced in Phase 8f.3. Complete shaper (R1-R5; no split matras). Gujarati becomes third registered Indic script.