ExPdfium.Text.Repair.ThaiPua (ExPdfium v0.4.3)

Copy Markdown View Source

Repairs the legacy "Windows Thai" Private Use Area (U+F700–F71A).

Pre-OpenType Thai fonts encode repositioned tone-mark and vowel glyphs in this private block; their ToUnicode CMaps therefore report PUA codepoints, which pdfium returns verbatim. Each is a positioning variant of a canonical Thai character (U+0E00–0E7F); this regime maps it back, 1:1 per codepoint.

Source: TLWG Thai shaping (https://linux.thai.net/~thep/th-otf/shaping.html) and the documented Microsoft Windows-Thai PUA convention.

Validation status (be honest about what is actually checked):

  • The six codepoints exercised by the fixture (F701, F702, F70A, F70B, F70E, F712) are validated end-to-end against the human-verified golden (test/fixtures/thai_pua.expected.txt).
  • The three tone-mark families (low-left F705–F709, low F70A–F70E, left F713–F717) are guarded by a structural-consistency test: each family must map in order onto MAI EK..THANTHAKHAT (U+0E48–0E4C). This is what catches a transcription slip — e.g. the F710 => 0x0E31 entry corrects a 0E46 (MAIYAMOK) error seen in a summarized rendering of the source.
  • The remaining singleton entries (F700, F703, F704, F70F, F711, F718–F71A) are transcribed from the cited source and follow its documented structure, but are not yet exercised by a fixture. Adding a Thai PDF that uses them would convert that transcription trust into a regression guard.

Summary

Functions

Returns {repaired_text, substitution_count}.

Returns {repairable?, evidence} where evidence is the count of mappable PUA codepoints.

Functions

apply(text)

Returns {repaired_text, substitution_count}.

detect(text)

Returns {repairable?, evidence} where evidence is the count of mappable PUA codepoints.

id()

kind()

source()