From b1d83e4d50d777e0054ab7b6ac3d3e1cd13a576b Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Fri, 23 Oct 2026 02:26:27 +0400 Subject: [PATCH 1/4] Fonts: embed craft-fonts a71c20e3 and serve Noto Sans Georgian on the web Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- .github/workflows/ci.yml | 2 +- .github/workflows/freebsd.yml | 2 +- .github/workflows/release.yml | 2 +- crates/text/src/scripts.rs | 2 +- crates/text/src/served.rs | 8 ++++++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b06e15449d..987215db73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,7 +278,7 @@ jobs: uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: repository: storytold/craft-fonts - ref: abb83316d96aa59c1cf64784289e378fe9fa5695 + ref: a71c20e30af613287c504f7e685ca8fad77752bc path: craft-fonts - name: Test with craft-fonts diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml index 56d1ad0831..02c7387448 100644 --- a/.github/workflows/freebsd.yml +++ b/.github/workflows/freebsd.yml @@ -30,7 +30,7 @@ jobs: # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos. uses: storytold/craft-common-actions/.github/workflows/freebsd.yml@main with: - craft-fonts-ref: abb83316d96aa59c1cf64784289e378fe9fa5695 + craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc cargo-build-extra-args: "--features heif" # The VM's software Vulkan driver crashes (SIGSEGV) when several tests set up a device at # once, so photocraft-gpu's tests run one at a time, like ui-egui's integration tests. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bfdca9e3e9..db81f742b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: with: app-name: photocraft app-title: PhotoCraft - craft-fonts-ref: abb83316d96aa59c1cf64784289e378fe9fa5695 + craft-fonts-ref: a71c20e30af613287c504f7e685ca8fad77752bc version: ${{ inputs.version }} secrets: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} diff --git a/crates/text/src/scripts.rs b/crates/text/src/scripts.rs index b6e0aae74f..3f8bfd1cb1 100644 --- a/crates/text/src/scripts.rs +++ b/crates/text/src/scripts.rs @@ -106,7 +106,7 @@ impl Script { ], Hebrew => &["notosanshebrew", "notoserifhebrew", "segoeui", "arialhb", "sfhebrew", "dejavusans", "arial", "freesans", "culmus"], Armenian => &["notosansarmenian", "notoserifarmenian", "segoeui", "sylfaen", "mshtakan", "dejavusans", "freesans"], - Georgian => &["notosansgeorgian", "notoserifgeorgian", "segoeui", "sylfaen", "dejavusans", "freesans"], + Georgian => &["notosansgeorgian", "notoserifgeorgian", "segoeui", "sylfaen", "sfgeorgian", "dejavusans", "freesans"], Ethiopic => &["notosansethiopic", "notoserifethiopic", "ebrima", "kefa", "abyssinicasil"], Devanagari => &[ "notosansdevanagari", diff --git a/crates/text/src/served.rs b/crates/text/src/served.rs index 0198aea97a..3d2206fd87 100644 --- a/crates/text/src/served.rs +++ b/crates/text/src/served.rs @@ -11,7 +11,7 @@ //! //! Script fallback: the manifest's `scripts` field says which scripts a font is for. The first //! served family listed for a script the bundled fonts don't cover (Arabic, Hebrew, Devanagari, -//! Thai, Khmer, Lao, Burmese, Japanese, Chinese, Korean) is that script's fallback: text in that script asks for it +//! Thai, Khmer, Lao, Burmese, Georgian, Japanese, Chinese, Korean) is that script's fallback: text in that script asks for it //! ([`request_for_text`], from layout), the font database puts it in the fallback stack once it //! arrives, and the web shell asks up front for the scripts of the browser's languages //! ([`request_for_languages`]). The manifest's SHA-256 becomes the fetch's Subresource Integrity @@ -63,7 +63,7 @@ fn is_relative_path(p: &str) -> bool { /// The scripts a served font can be the fallback for: those the bundled fonts (Inter, which covers /// Latin, Greek and Cyrillic) lack, as ISO 15924 codes. -const FALLBACK_SCRIPTS: &[&str] = &["Arab", "Hebr", "Deva", "Thai", "Khmr", "Laoo", "Mymr", "Jpan", "Hans", "Hant", "Kore"]; +const FALLBACK_SCRIPTS: &[&str] = &["Arab", "Hebr", "Deva", "Thai", "Khmr", "Laoo", "Mymr", "Geor", "Jpan", "Hans", "Hant", "Kore"]; /// The script fallbacks in `fonts`: for each script in [`FALLBACK_SCRIPTS`], the first family in /// manifest order that lists it, as `(script, family)` in order of first appearance. @@ -99,6 +99,7 @@ pub fn script_of(c: char, order: &[crate::cjk::CjkScript; 4]) -> Option<&'static 0x1780..=0x17FF | 0x19E0..=0x19FF => "Khmr", 0x0E80..=0x0EFF => "Laoo", 0x1000..=0x109F | 0xA9E0..=0xA9FF | 0xAA60..=0xAA7F => "Mymr", + 0x10A0..=0x10FF | 0x1C90..=0x1CBF | 0x2D00..=0x2D2F => "Geor", _ => return None, }) } @@ -117,6 +118,7 @@ pub fn language_script(tag: &str) -> Option<&'static str> { "km" => "Khmr", "lo" => "Laoo", "my" => "Mymr", + "ka" => "Geor", "ja" => "Jpan", "ko" => "Kore", "zh" if rest.iter().any(|r| matches!(*r, "hant" | "tw" | "hk" | "mo")) => "Hant", @@ -411,6 +413,7 @@ mod tests { ('ລ', Some("Laoo")), ('မ', Some("Mymr")), ('ၡ', Some("Mymr")), + ('ა', Some("Geor")), ('あ', Some("Jpan")), ('한', Some("Kore")), ] { @@ -433,6 +436,7 @@ mod tests { ("km-KH", Some("Khmr")), ("lo", Some("Laoo")), ("my-MM", Some("Mymr")), + ("ka-GE", Some("Geor")), ("ja-JP", Some("Jpan")), ("zh-CN", Some("Hans")), ("zh-TW", Some("Hant")), From d6be4c6d9288e5a4a993570a772ebfec2327c365 Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Sat, 24 Oct 2026 15:13:45 +0400 Subject: [PATCH 2/4] Text: Georgian joins the craft-fonts script fallback test With craft-fonts a71c20e3 or later, Georgian layer text falls back to Noto Sans Georgian. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- crates/text/src/tests.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/text/src/tests.rs b/crates/text/src/tests.rs index 4fe9709942..ccb8739424 100644 --- a/crates/text/src/tests.rs +++ b/crates/text/src/tests.rs @@ -2057,12 +2057,13 @@ fn craft_fonts_cover_japanese_without_system_fonts() { assert!(craft_family_of(&l).is_empty()); } -/// Chinese, Arabic and Thai set in Inter fall back to the craft font for their script when the -/// build has one (Noto Sans CJK SC, Noto Sans Arabic and Noto Sans Thai in newer craft-fonts). +/// Chinese, Arabic, Thai and Georgian set in Inter fall back to the craft font for their script when +/// the build has one (Noto Sans CJK SC, Noto Sans Arabic, Noto Sans Thai and Noto Sans Georgian in +/// newer craft-fonts). #[test] fn craft_fonts_cover_their_other_scripts_without_system_fonts() { let mut e = TextEngine::new(); - for (script, text) in [("Hans", "中文图层"), ("Arab", "مرحبا"), ("Thai", "ภาษาไทย")] { + for (script, text) in [("Hans", "中文图层"), ("Arab", "مرحبا"), ("Thai", "ภาษาไทย"), ("Geor", "ქართული შრე")] { if !crate::CRAFT_FONTS.iter().any(|f| f.scripts.contains(&script)) { eprintln!("skipping {script}: built without a craft font for it (set CRAFT_FONTS_DIR to a craft-fonts checkout)"); continue; From 94c97187ca7b95809521158efe50f85e3a83484e Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Sat, 24 Oct 2026 16:40:54 +0400 Subject: [PATCH 3/4] Text: Georgian families in the fallback candidates, so Georgian set in Inter draws with Noto Sans Georgian Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- crates/text/src/fonts.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/text/src/fonts.rs b/crates/text/src/fonts.rs index a0b64f4e3b..d80b9a208e 100644 --- a/crates/text/src/fonts.rs +++ b/crates/text/src/fonts.rs @@ -78,6 +78,9 @@ pub const LAO_FAMILIES: &[&str] = &["Lao Sangam MN", "Lao MN", "Lao UI", "Noto S /// Myanmar/Burmese-capable families: macOS (Myanmar Sangam MN, Myanmar MN), Windows (Myanmar Text) /// and Linux (Noto). pub const MYANMAR_FAMILIES: &[&str] = &["Myanmar Sangam MN", "Myanmar MN", "Myanmar Text", "Noto Sans Myanmar"]; +/// Georgian-capable families: craft-fonts and Linux (Noto), Windows (Sylfaen). Georgian in a font +/// without Mkhedruli glyphs falls back to these. +pub const GEORGIAN_FAMILIES: &[&str] = &["Noto Sans Georgian", "Noto Serif Georgian", "Sylfaen"]; /// Indic-script families for document text. Windows has `Nirmala UI` for all nine scripts (from /// Windows 8); macOS has the Kohinoor and Sangam MN families; Linux has Noto Sans. Indic text in a /// font without these glyphs had no candidate to fall back to and drew .notdef boxes (#218). @@ -121,6 +124,7 @@ pub fn fallback_candidates(order: &[crate::cjk::CjkScript; 4]) -> Vec<&'static s v.extend_from_slice(KHMER_FAMILIES); v.extend_from_slice(LAO_FAMILIES); v.extend_from_slice(MYANMAR_FAMILIES); + v.extend_from_slice(GEORGIAN_FAMILIES); for fams in INDIC_FAMILIES { for f in *fams { // Nirmala UI covers all nine scripts and is listed by each; probe it once. From 20d79193b5f5d01c811e605a2c9d154bf9b0d6e8 Mon Sep 17 00:00:00 2001 From: Davit Matchakhelidze Date: Sun, 25 Oct 2026 01:42:35 +0400 Subject: [PATCH 4/4] Text: macOS's .SF Georgian among the Georgian fallback families Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF --- crates/text/src/fonts.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/text/src/fonts.rs b/crates/text/src/fonts.rs index d80b9a208e..28e258b367 100644 --- a/crates/text/src/fonts.rs +++ b/crates/text/src/fonts.rs @@ -78,9 +78,9 @@ pub const LAO_FAMILIES: &[&str] = &["Lao Sangam MN", "Lao MN", "Lao UI", "Noto S /// Myanmar/Burmese-capable families: macOS (Myanmar Sangam MN, Myanmar MN), Windows (Myanmar Text) /// and Linux (Noto). pub const MYANMAR_FAMILIES: &[&str] = &["Myanmar Sangam MN", "Myanmar MN", "Myanmar Text", "Noto Sans Myanmar"]; -/// Georgian-capable families: craft-fonts and Linux (Noto), Windows (Sylfaen). Georgian in a font -/// without Mkhedruli glyphs falls back to these. -pub const GEORGIAN_FAMILIES: &[&str] = &["Noto Sans Georgian", "Noto Serif Georgian", "Sylfaen"]; +/// Georgian-capable families: craft-fonts and Linux (Noto), Windows (Sylfaen), macOS (".SF Georgian", +/// a hidden system face). Georgian in a font without Mkhedruli glyphs falls back to these. +pub const GEORGIAN_FAMILIES: &[&str] = &["Noto Sans Georgian", "Noto Serif Georgian", "Sylfaen", ".SF Georgian"]; /// Indic-script families for document text. Windows has `Nirmala UI` for all nine scripts (from /// Windows 8); macOS has the Kohinoor and Sangam MN families; Linux has Noto Sans. Indic text in a /// font without these glyphs had no candidate to fall back to and drew .notdef boxes (#218).