mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-27 03:47:09 -06:00
A paragraph in a Thai font that isn't installed (TH Sarabun New, Angsana New, Cordia New, the UPC families…) drew its Thai letters in one fallback face and the Latin letters, digits and baht sign in a Latin substitute at a visibly different size. Word substitutes one font (Cordia New) for the whole run. Thai families now have their own substitute lists (Cordia New and Leelawadee UI on Windows, Thonburi on macOS, Noto Sans Thai and the TLWG fonts on Linux; serif families prefer Angsana New, Sathu or Noto Serif Thai), and the first listed face with Latin letters and digits as well as Thai wins. When the substitute still lacks some of the run's Thai or Latin text, the run moves to one face covering it through FontDb::fallback_for_run, the generalised East Asian run fallback. Only Thai fonts get this: a missing Latin font keeps Latin text in its own substitute, a run with its own complex-script font keeps it for the Thai letters, and a missing roman-classed Thai font is no longer drawn in Cambria. Co-authored-by: Brandon Thomas <echelon@gmail.com>