ApplyBengaliReorder
Signature
function ApplyBengaliReorder(const Wide: UnicodeString): UnicodeString;
Purpose
Applies the Bengali reorder pre-pass to Wide and returns a UnicodeString prepared for cmap and GSUB consumption. Text outside Bengali remains byte-stable, so callers can route mixed text without changing unrelated runs
Coverage
- Bengali uses the
bengscript record for U+0980-U+09FF. The documented path covers R1, R2, R4, R5, and split-matra decomposition while preserving API behaviour for producer-side shaping(Ra, Halant)pair moves to the syllable end. ApplyIndicReorderdispatches to this helper when the active codepoint range matches U+0980-U+09FFU+09C7E,U+09C8AI move to the syllable start. Note Bengali E/AI are pre-base, unlike Devanagari where they are above-base.- R3 Above-base matras: (empty for Bengali — no above-base matras in the main block)
- R4 Below-base matras:
U+09C1–U+09C4U/UU/Vocalic R/RR,U+09E2–U+09E3Vocalic L/LL emit after the base. - R5 Post-base matras:
U+09BEAA,U+09C0II,U+09D7AU length mark emit after below-base. - Split matras:
U+09CBOo decomposes toU+09C7(pre) +U+09BE(post);U+09CCAU decomposes toU+09C7(pre) +U+09D7(post).
Output layout per syllable: [pre-matras] + [base + halant + nukta + bindu/visarga/modifier] + [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 + Oo-matra (single codepoint U+09CB)
Wide:= Doc.ApplyBengaliReorder(#$0995#$09CB);
// Wide is now: U+09C7 + KA + U+09BE (Oo decomposed to pre+post)
end;
See also
ApplyIndicReorder- coverageGetBengaliCategory- Bengali category lookupGetBengaliCategory— Unicode codepoint → category lookup.
Standards
- Unicode 16.0 §12.2 (Bengali)
- Unicode 16.0
IndicSyllabicCategory.txtandIndicPositionalCategory.txt - ISO 32000-1 §9.10
- OpenType Bengali shaping specification
Version history
- v2.119.71 - Introduced as part of the HotPDF Indic shaping batch