ApplySinhalaReorder

Signature

function ApplySinhalaReorder(const Wide: UnicodeString): UnicodeString;

Purpose

Applies the Sinhala reorder pre-pass to Wide and returns a UnicodeString prepared for cmap and GSUB consumption. Text outside Sinhala remains byte-stable, so callers can route mixed text without changing unrelated runs

Coverage

  • Sinhala uses the sinh script record for U+0D80-U+0DFF. The documented path covers R1-R5 with Sinhala pre-base and split-matra handling while preserving API behaviour for producer-side shaping
  • ApplyIndicReorder dispatches to this helper when the active codepoint range matches U+0D80-U+0DFF

Example

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;

See also

Standards

  • Unicode 16.0 U+0D80-U+0DFF
  • ISO 32000-1 ยง9.10
  • OpenType Sinhala shaping specification

Version history

  • v2.119.77 - Introduced as part of the HotPDF Indic shaping batch