review(#1657): Lao is selectable and renders on the web

- Language gains lo-LA, labelled ລາວ in every catalog, so the new
  translation can be chosen.
- Two Lao keys under stale names now use the catalog's names, and the
  touchpad option added since gets its Lao label.
- The web build gets a Lao font (Noto Sans Lao, generated like Thai) and
  routes Lao and Thai drawing text to their fonts; Thai had a font but
  was never routed to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-08 11:19:59 +03:00
1 parent ca84ff9cdb
commit 1882773418
26 files changed
+43 -3

No files matched your search

+9
View File
@@ -31,6 +31,7 @@ pub enum Script {
Arabic,
Hebrew,
Thai,
Lao,
Devanagari,
Chinese,
TraditionalChinese,
@@ -49,6 +50,7 @@ impl Script {
Script::Arabic => "fonts/arabic.ttf",
Script::Hebrew => "fonts/hebrew.ttf",
Script::Thai => "fonts/thai.ttf",
Script::Lao => "fonts/lao.ttf",
Script::Devanagari => "fonts/devanagari.ttf",
Script::Chinese => "fonts/chinese.ttf",
Script::TraditionalChinese => "fonts/traditional_chinese.ttf",
@@ -69,6 +71,7 @@ impl Script {
| Script::Arabic
| Script::Hebrew
| Script::Thai
| Script::Lao
| Script::Devanagari => "Noto Sans",
}
}
@@ -85,6 +88,7 @@ impl Script {
8 => Script::Japanese,
9 => Script::Korean,
10 => Script::TraditionalChinese,
11 => Script::Lao,
_ => Script::Latin,
}
}
@@ -103,6 +107,7 @@ impl Script {
Script::Japanese => 8,
Script::Korean => 9,
Script::TraditionalChinese => 10,
Script::Lao => 11,
}
}
}
@@ -143,6 +148,7 @@ pub fn scripts_for_language_tag(language: &str) -> Vec<Script> {
"ko" => Some(Script::Korean),
"ru" | "uk" | "bg" | "sr" => Some(Script::Cyrillic),
"th" => Some(Script::Thai),
"lo" => Some(Script::Lao),
"zh" => Some(Script::Chinese),
_ => None,
}
@@ -176,6 +182,7 @@ pub fn requires_shaping(text: &str) -> bool {
| 0x08A0..=0x08FF
| 0x0900..=0x097F
| 0x0E00..=0x0E7F
| 0x0E80..=0x0EFF
| 0xA8E0..=0xA8FF
| 0xFB1D..=0xFB4F
| 0xFB50..=0xFDFF
@@ -224,6 +231,8 @@ pub fn script_of(ch: char) -> Option<Script> {
Script::Arabic
}
0x0900..=0x097F | 0xA8E0..=0xA8FF => Script::Devanagari,
0x0E00..=0x0E7F => Script::Thai,
0x0E80..=0x0EFF => Script::Lao,
// Hangul → always Korean; kana → always Japanese.
0x1100..=0x11FF | 0x3130..=0x318F | 0xAC00..=0xD7A3 => Script::Korean,
0x3040..=0x30FF | 0x31F0..=0x31FF => Script::Japanese,