ApplyBengaliReorder

签名

function ApplyBengaliReorder(const Wide: UnicodeString): UnicodeString;

用途

对 Wide 应用 Bengali 重排预处理,返回可交给 cmap + GSUB 消费的重排后 UnicodeString。非 Bengali 内容(拉丁字母、数字、标点,以及其他文字,包括其他 Indic 文字)按字节原样通过

应用的重排规则

  • R1 Repha:音节以 Ra (U+09B0) + Halant (U+09CD) + Consonant 开头时,(Ra, Halant) 对移到音节末尾
  • R2 前置 matra:U+09BF I、U+09C7 E、U+09C8 AI 移至音节起始。注意 Bengali 的 E/AI 是前置的,不像 Devanagari 那样位于上方
  • R3 上方 matra:(Bengali 为空 — 主区块没有上方 matra)
  • R4 下方 matra:U+09C1–U+09C4 U/UU/Vocalic R/RR、U+09E2–U+09E3 Vocalic L/LL 在基础之后发出
  • R5 后置 matra:U+09BE AA、U+09C0 II、U+09D7 AU 长度记号在下方 matra 之后发出
  • 拆分 matra:U+09CB Oo 分解为 U+09C7(前置)+ U+09BE(后置);U+09CC AU 分解为 U+09C7(前置)+ U+09D7(后置)

每个音节的输出布局:[pre-matras] + [base + halant + nukta + bindu/visarga/modifier] + [below-matras] + [post-matras] + [Repha: Ra Halant]?

辅音连串(C + Halant + C)保留在基础块中;单遍处理,且对简单输入幂等

示例

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;

另请参阅

标准

  • Unicode 16.0 §12.2(Bengali)
  • Unicode 16.0 IndicSyllabicCategory.txt 与 IndicPositionalCategory.txt
  • ISO 32000-1 §9.10(文本内容提取)
  • OpenType Bengali shaping 规范

版本历史

  • v2.119.71 — 在 Phase 8f.2 中引入。完整 shaper(R1、R2、R4、R5 + 拆分 matra 分解)。Bengali 成为继 Devanagari 之后第二个注册的 Indic 文字