ApplySinhalaReorder

簽章

function ApplySinhalaReorder(const Wide: UnicodeString): UnicodeString;

用途

對 Wide 套用 Sinhala 重排預處理,並傳回可交給 cmap 與 GSUB 使用的 UnicodeString。Sinhala 之外的文字與資料保持位元組穩定

涵蓋範圍

  • Sinhala 對 U+0D80-U+0DFF 使用 sinh script 記錄。涵蓋範圍包含 R1-R5 with Sinhala pre-base and split-matra handling,並維持產生端 API 行為穩定'rphf'
  • MatraPos = 1):E(U+0DD9)、EE(U+0DDA)、AI(U+0DDB)。在 Phase 8f 的 Brahmic 文字之中,僧伽羅文獨有三個邏輯上的前置 matra — EE 與 AI 的視覺位置是 Top_And_Left,卻以前置形式儲存;視覺上的上方部件由字型 GSUB 轉譯。
  • 三個分割 matra,具有 Unicode 16.0 規範分解:
    • U+0DDC O → U+0DD9(前)+ U+0DCF(後)。
    • U+0DDD OO → U+0DD9(前)+ U+0DCF(後)+ U+0DCA(後) — 三段分割;結尾的 AL-LAKUNA 是規範分解的一部分,不是音節層級的 virama。
    • U+0DDE AU → U+0DD9(前)+ U+0DDF(後)。
  • 上方 matra(MatraPos = 3):I(U+0DD2)、II(U+0DD3)。
  • 下方 matra(MatraPos = 4):U(U+0DD4)、UU(U+0DD6)。
  • 後置 matra(MatraPos = 2):AA(U+0DCF)、AE / AAE(U+0DD0–U+0DD1)、Vocalic R matra(U+0DD8)、L matra(U+0DDF)、LL / LLL matra(U+0DF2–U+0DF3)。
  • 僧伽羅文的 Halant 稱為 AL-LAKUNA(U+0DCA);RA(Repha 觸發符)是 U+0DBB。

重排規則

  • R1 Repha:位於音節開頭的 Ra + AL-LAKUNA 重新輸出到音節結尾。
  • R2 前置 matra:E / EE / AI 在基底塊之前輸出。
  • R3 上方 matra:I / II 在基底塊之後輸出。
  • R4 下方 matra:U / UU 在上方塊之後輸出。
  • R5 後置 matra:AA / AE / AAE / Vocalic R / L / LL / LLL matra 在下方塊之後輸出。
  • 分割 matra 分解:O / OO / AU 依 Unicode 16.0 規範分解展開;OO 是此塑形器家族第一次從非 Kannada 來源 codepoint 產生三段分割。

每個音節的輸出布局:[前置 matra] + [基底 + halant + bindu/visarga] + [上方 matra] + [下方 matra] + [後置 matra] + [Repha: Ra AL-LAKUNA]? ApplyIndicReorder dispatches to this helper when the active codepoint range matches U+0D80-U+0DFF

範例

var
  Wide: UnicodeString;
begin
  // Input: KA (U+0D9A) + O-matra (U+0DDC, 2-part split: pre + post)
  Wide:= Doc.ApplySinhalaReorder(#$0D9A#$0DDC);
  // Wide is now: E (U+0DD9, pre) + KA + AA (U+0DCF, post)
end;

另請參閱

標準

  • Unicode 16.0 U+0D80-U+0DFF
  • ISO 32000-1 §9.10IndicSyllabicCategory.txt、IndicPositionalCategory.txt 與 UnicodeData.txt
  • OpenType Sinhala shaping specification
  • OpenType Sinhala 塑形規格(文字系統 tag 'sinh'

版本歷史

  • v2.119.77 - 作為 HotPDF Indic 塑形批次的一部分導入U+0DDD