From dd148d2504369af8706f55758d0add052611108d Mon Sep 17 00:00:00 2001 From: giswqs Date: Sat, 7 Nov 2026 18:22:32 -0500 Subject: [PATCH 1/2] test(ui): install the Persian face in the right-to-left note test The test installed only the interface face. On macOS that is San Francisco, which has no Persian glyphs, so epaint panicked on U+06CC and the macOS test job failed on main since #1429. Install the Arabic script face the way the app does for Persian, and skip where no installed face draws Persian. --- crates/ui-egui/src/searchbox.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/searchbox.rs b/crates/ui-egui/src/searchbox.rs index 048d8b5be5..5fcc842a6e 100644 --- a/crates/ui-egui/src/searchbox.rs +++ b/crates/ui-egui/src/searchbox.rs @@ -600,12 +600,21 @@ mod tests { /// first row holds the start of the sentence. #[test] fn a_right_to_left_note_keeps_its_rows_in_reading_order() { + use rustgis_engine::render::fonts::{ScriptFont, script_font}; let text = "هیچ مکانی در این مرجع شبکه نیست زیرا حرف پس از منطقه کمربند عرض جغرافیایی است"; - // The interface fonts, which hold the Persian glyphs, are in from the next frame on. + // The Persian face, as the app installs it for Persian: the interface face alone has no + // Persian glyphs on macOS (San Francisco) or with the built-in fonts. + let Some((bytes, _)) = script_font(ScriptFont::Arabic) else { + eprintln!("skipped: no installed face draws Persian"); + return; + }; + let extra = + vec![("script-arabic".to_string(), std::sync::Arc::new(egui::FontData::from_owned(bytes.clone())), Some(ScriptFont::Arabic))]; + // The fonts are in from the next frame on. let mut fonts = false; let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(220.0, 300.0)).build_ui(move |ui| { if !fonts { - crate::theme::install_fonts(ui.ctx(), &[], None); + crate::theme::install_fonts(ui.ctx(), &extra, Some(ScriptFont::Arabic)); fonts = true; return; } From 027e05938b18b88654e0eea782493e5a3c673bf9 Mon Sep 17 00:00:00 2001 From: giswqs Date: Sat, 7 Nov 2026 18:50:34 -0500 Subject: [PATCH 2/2] test(ui): fail the right-to-left note test on CI when no Persian face is found A skip passes green, so on CI (CI set) a missing face is a failure; developer machines without one still skip. --- crates/ui-egui/src/searchbox.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/searchbox.rs b/crates/ui-egui/src/searchbox.rs index 5fcc842a6e..0033bf8c5b 100644 --- a/crates/ui-egui/src/searchbox.rs +++ b/crates/ui-egui/src/searchbox.rs @@ -605,6 +605,8 @@ mod tests { // The Persian face, as the app installs it for Persian: the interface face alone has no // Persian glyphs on macOS (San Francisco) or with the built-in fonts. let Some((bytes, _)) = script_font(ScriptFont::Arabic) else { + // On CI a missing face fails, so the check is never skipped there unseen. + assert!(std::env::var_os("CI").is_none(), "no installed face draws Persian"); eprintln!("skipped: no installed face draws Persian"); return; };