ApplyIndicReorder

簽章

function ApplyIndicReorder(const Wide: UnicodeString): UnicodeString;

用途

將 Indic 文字分派到各 script 已註冊的重排輔助函式。它會掃描 Wide、切分 script 範圍、保持非 Indic 文字與資料位元組穩定,並為 cmap 與 GSUB 做準備TIndicScriptInfo entry by Unicode-block range, and applies that script's syllable + reorder callbacks. Non-Indic codepoints pass through byte-identical. Script-boundary transitions inside Wide automatically segment

涵蓋範圍

  • Devanagari (deva, U+0900-U+097F) - R1-R5 with conjunct preservation
  • Bengali (beng, U+0980-U+09FF) - R1, R2, R4, R5, and split-matra decomposition
  • Gujarati (gujr, U+0A80-U+0AFF) - R1-R5 with no split matras
  • Tamil (taml, U+0B80-U+0BFF) - R2-R5 with Tamil split-matra handling and no Repha
  • Telugu (telu, U+0C00-U+0C7F) - R1, R3, R4, and Telugu split-matra handling
  • Kannada (knda, U+0C80-U+0CFF) - R1, R3, R4, R5, and Kannada split-matra handlingmlym, U+0D00-U+0D7F) - R1, R2, R4, R5, split matras, chillu letters, and DOT REPH
  • Sinhala (sinh, U+0D80-U+0DFF) - R1-R5 with Sinhala pre-base and split-matra handlingU+0D3F) is post-base (Tamil-like, unique vs Devanagari/Bengali/Gujarati). Chillu letters (U+0D54–U+0D56, U+0D7A–U+0D7F) and DOT REPH (khmr, U+1780-U+17FF) - independent South-East Asian syllable processing
  • Myanmar (mymr, U+1000-U+109F and U+AA60-U+AA7F) - Kinzi, medial sorting, pre-base vowel, ASAT, and stacked-consonant handlingU+0DD9、EE=U+0DDA、AI=U+0DDB) — Phase 8f 文字中最多的前置 matra 數量。U+0DDD OO 是三段分割(前 + 後 + 後)。補齊 Brahmic SIA(South Indic Aryan)家族。
  • Khmer('khmr',U+1780–U+17FF) — 第一個東南亞文字;獨立的音節 FSM(非 Brahmic R1-R5)。不萃取 Repha。COENG(U+17D2)+ 子音配對形成疊接下標並保持在 cluster 內(下標定位由 GSUB 處理)。六個前置母音(E/AE/AI/OE/OO/AU)移到音節開頭;聲域移位符(U+17C9 MUUSIKATOAN、U+17CA TRIISAP)與其他符號送往上方緩衝區;Bindu(NIKAHIT U+17C6)→ 上方;Visarga(REAHMUK / YUUKALEAPINTU U+17C7/U+17C8)→ 後置。
  • Myanmar('mymr',U+1000–U+109F + U+AA60–U+AA7F Extended-A) — 批次中音節結構最複雜者。不萃取 Repha。Kinzi 3-CP 前置(U+1004 + U+103A + U+1039)在音節開頭偵測,暫存後依 R8 在輸出開頭輸出。前置母音 E(U+1031)依 R10 移到音節開頭。四個介音子音(U+103B YA、U+103C RA、U+103D WA、U+103E HA)依 R9 以固定的 Y → R → W → H 順序輸出,與來源順序無關。ASAT(U+103A)與 VIRAMA(U+1039)都視為 virama。重排演算法使用 8 個緩衝槽位:Kinzi + 前置母音 + 基底 + (介音Y/R/W/H) + 上方 + 下方 + 後置。兩個 IndicScripts 項目(主區塊 + Extended-A)共用同一組 Myanmar 重排函式。

本階段之後,11 階段的非 Devanagari Indic 塑形批次即告完成: Phase 8f.0(基礎架構)與 8f.1–8f.10(10 個已註冊文字 — Brahmic SIA 家族 + 2 個東南亞文字)。未來的塑形工作 可能在 Phase 8g+ 加入 Myanmar Extended-B / Extended-C、藏文、寮文 / 泰文等 東南亞文字,或其他 Unicode §12-§16 範圍

生產端自動套用

當 FShapingFeatures 含有 sfIndicShaping 時, ApplyIndicReorder 會在用於 AcroForm 外觀 stream 產生的三個 BuildUnicode*FieldContent 輔助方法內自動呼叫。略過 BuildUnicode* 的呼叫端,可在把文字餵進 cmap + GSUB 管線前(透過 SetGSUBScript('deva') 等)直接呼叫 ApplyIndicReorder

範例

var
  Wide: UnicodeString;
begin
  Wide:= Doc.ApplyIndicReorder('Hello '+ #$0915#$093F+ ' world.');
  // Result: 'Hello ' + I-matra + KA + ' world.'
  // (Latin segments unchanged; Devanagari segment reordered.)
end;

另請參閱

標準

  • Unicode 16.0 chapters 12 and 16
  • ISO 32000-1 §9.10
  • OpenType per-script shaping specifications

版本歷史

  • v2.119.69-v2.120.10 - Indic 重排基礎架構和已註冊 script 批次
  • v2.119.70 — Devanagari 在 Phase 8f.1 升級為完整塑形器(R1-R5 + 連結字保留)。
  • v2.119.71 — Bengali 註冊為第二個 Indic 文字(Phase 8f.2)。
  • v2.119.72 — Gujarati 註冊為第三個 Indic 文字(Phase 8f.3)。
  • v2.119.73 — Tamil 註冊為第四個 Indic 文字(Phase 8f.4)。
  • v2.119.74 — Telugu 註冊為第五個 Indic 文字(Phase 8f.5)。
  • v2.119.75 — Kannada 註冊為第六個 Indic 文字(Phase 8f.6)。第一個展示三段分割 matra 分解的文字。
  • v2.119.76 — Malayalam 註冊為第七個 Indic 文字(Phase 8f.7)。加入 chillu 子音(U+0D54-U+0D56、U+0D7A-U+0D7F)與 Malayalam 特有的 DOT REPH(U+0D4E)子音類別;I-matra 後置與 Tamil 相同。
  • v2.119.77 — Sinhala 註冊為第八個 Indic 文字(Phase 8f.8)。三個前置 matra(E/EE/AI)— Phase 8f 文字中最多。U+0DDD OO 是三段分割(前 + 後 + 後)。補齊 Brahmic SIA(South Indic Aryan)家族。
  • v2.120.9 — Khmer 註冊為第九個 Indic 文字(Phase 8f.9)。第一個東南亞文字;獨立的音節 FSM,COENG(U+17D2)下標處理保持在 cluster 內(無 Repha、無 Brahmic R1-R5)。六個前置母音旋轉到音節開頭;聲域移位符與其他符號送往上方緩衝區;Bindu 與 Visarga 有專屬的上方 / 後置路由。依 Unicode 16.0 §16.4 與 OpenType Khmer 塑形規格。
  • v2.120.10 — Myanmar 註冊為第十個也是最後一個 Indic 文字(Phase 8f.10)。兩個 IndicScripts 項目涵蓋 Myanmar 核心區塊(U+1000–U+109F)與 Extended-A(U+AA60–U+AA7F)。批次中音節結構最複雜者:Kinzi 3-CP 前置偵測(R8)、前置 E 母音旋轉(R10)、固定的 Y → R → W → H 介音排序(R9)、ASAT / VIRAMA 疊接子音處理、DOT BELOW / 聲調符號路由。8 槽位緩衝區模型。完成 11 階段的非 Devanagari Indic 塑形批次(Phase 8f.0–8f.10):基礎架構 + 10 個已註冊 Indic 文字,涵蓋 Brahmic SIA 家族與 2 個東南亞文字。依 Unicode 16.0 §16.3 與 OpenType Myanmar 塑形規格。