ApplyMyanmarReorder
簽章
function ApplyMyanmarReorder(const Wide: UnicodeString): UnicodeString;
用途
對 Wide 套用 Myanmar 重排預處理,並傳回可交給 cmap 與 GSUB 使用的 UnicodeString。Myanmar 之外的文字與資料保持位元組穩定
涵蓋範圍
- Myanmar 對 U+1000-U+109F and U+AA60-U+AA7F 使用
- Kinzi 3-CP prefix: the exact sequence
U+1004(NGA) +mymrscript 記錄。涵蓋範圍包含Kinzi, medial sorting, pre-base vowel, ASAT, and stacked-consonant handling,並維持產生端 API 行為穩定 ApplyIndicReorderdispatches to this helper when the active codepoint range matches U+1000-U+109F and U+AA60-U+AA7F- Medial consonants (
U+103BYA,U+103CRA,U+103DWA,U+103EHA) are collected into 4 dedicated slots and emitted in fixed Y → R → W → H order per R9, regardless of source order. Well-formed Myanmar syllables rarely have all 4 medials, but the algorithm handles any subset. - ASAT (
U+103A) and VIRAMA (U+1039) are both treated as virama (category 4) for the stacked-consonant FSM. ASAT used standalone (not as part of Kinzi) stays in BaseBuf at its source position. - Above-base vowels (
MatraPos = 3): I (U+102D), II (U+102E), AI (U+1032), Vocalic R / L variants (U+1033–U+1035). - Below-base vowels (
MatraPos = 4): U (U+102F), UU (U+1030), Vocalic L / LL matras (U+1058–U+1059). - Post-base vowels (
MatraPos = 2): TALL AA (U+102B), AA (U+102C), Vocalic R / RR matras (U+1056–U+1057). - ANUSVARA (Bindu
U+1036) routes to above-base. - VISARGA (
U+1038) routes to post-base. - DOT BELOW (
U+1037) and other tone marks share category 12, but the reorder pre-pass routes DOT BELOW to below-base and other tones to above-base. - Coverage spans the Myanmar core block (
U+1000–U+109F, including Burmese, Mon, Sgaw Karen, Western Pwo, Shan, Rumai Palaung, Pa'o vowel positions) and Extended-A (U+AA60–U+AA7F, additional ethnic-language consonants and Pa'o Karen tone marks).
重排行為
- Kinzi 3 CPs emit at syllable start (before all other content).
- Pre-base E vowel emits before the base block.
- Base block contains: base consonant, ASAT, VIRAMA, virama-stacked consonants, MEDIAL MON LA (
U+1082, which is not part of the Y/R/W/H set), GREAT SA (U+103F), ZWJ / ZWNJ — all in source order. - Medials emit in fixed Y → R → W → H order regardless of source order.
- Above-base block: vowels, ANUSVARA, non-DOT-BELOW tone marks.
- Below-base block: vowels, DOT BELOW.
- Post-base block: vowels, VISARGA.
Output layout per syllable: [Kinzi 3 CPs]? + [Pre-base E] + [Base + ASAT + stacked consonants] + [MedialY + MedialR + MedialW + MedialH] + [Above] + [Below] + [Post]. Single-pass; idempotent (Kinzi at start stays at start; sorted medials stay sorted; pre-base E at start stays at start)
範例
var
Wide: UnicodeString;
begin
// Input: KA (U+1000) + E-vowel (U+1031, pre-base)
Wide:= Doc.ApplyMyanmarReorder(#$1000#$1031);
// Wide is now: E (U+1031) + KA (U+1000)
// Input: Kinzi (U+1004 U+103A U+1039) + KA + AA-vowel (U+102C)
Wide:= Doc.ApplyMyanmarReorder(#$1004#$103A#$1039#$1000#$102C);
// Wide unchanged: Kinzi + KA + AA (all in canonical positions)
// Input: KA + medials H + W + R + Y (reversed source order)
Wide:= Doc.ApplyMyanmarReorder(#$1000#$103E#$103D#$103C#$103B);
// Wide is now: KA + Y + R + W + H (R9 sorted)
end;
另請參閱
ApplyIndicReorder- 涵蓋範圍GetMyanmarCategory- Myanmar category lookup- Unicode 16.0 U+1000-U+109F and U+AA60-U+AA7F
ApplyBengaliReorder— Bengali counterpart. - ISO 32000-1 §9.10
ApplyGujaratiReorder— Gujarati counterpart. - OpenType Myanmar shaping specification
ApplyTamilReorder— Tamil counterpart. ApplyTeluguReorder— Telugu counterpart.ApplyKannadaReorder— Kannada counterpart.ApplyMalayalamReorder— Malayalam counterpart.ApplySinhalaReorder— Sinhala counterpart.ApplyKhmerReorder— Khmer counterpart (first SE Asian script).GetMyanmarCategory— Unicode codepoint → category lookup.
版本歷史
- v2.120.10 - 作為 HotPDF Indic 塑形批次的一部分導入
- Unicode 16.0
IndicSyllabicCategory.txt,IndicPositionalCategory.txt - ISO 32000-1 §9.10 (extraction of text content)
- OpenType Myanmar shaping spec (script tag
'mymr')
Version history
- v2.120.10 — Introduced in Phase 8f.10. Complete shaper with Kinzi 3-CP prefix detection (R8), pre-base E vowel rotation (R10), medial Y/R/W/H fixed-order sorting (R9), ASAT/VIRAMA stacked-consonant handling, and DOT BELOW / tone mark routing. Both Myanmar core block (
U+1000–U+109F) and Extended-A (U+AA60–U+AA7F) registered as separateIndicScriptsentries sharing the same Myanmar reorder functions. Completes the 11-Phase non-Devanagari Indic shaping batch (Phases 8f.0–8f.10): infrastructure + 10 registered Indic scripts covering the Brahmic SIA family plus 2 South-East Asian scripts.