From 9b4e6366cb8e785117efd750181bee6ffe26fec2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 07:17:43 -0800 Subject: [PATCH] Tests: the short-screen dialog test draws missing Gujarati as a box CI's craft-fonts pin (b076417) has a Devanagari face but no Gujarati one, so the Import Shortcut Set case passed its Devanagari guard and then panicked in epaint on the Gujarati language name in the Keyboard Shortcuts list ("No glyph for U+0A97"). That case now sets the missing-glyph policy to tofu when no Gujarati face is embedded. The test checks where buttons and rows stand, not glyph coverage, so it keeps running in CI. --- crates/ui-egui/src/tests/dialog_layout.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/tests/dialog_layout.rs b/crates/ui-egui/src/tests/dialog_layout.rs index d5e5b8ddd0..9911e89750 100644 --- a/crates/ui-egui/src/tests/dialog_layout.rs +++ b/crates/ui-egui/src/tests/dialog_layout.rs @@ -196,17 +196,21 @@ fn dialogs_on_a_short_screen_keep_their_buttons_and_rows_in_reach() { ), ]; // The Keyboard Shortcuts window behind Import Shortcut Set lists the language commands in their own - // scripts, which need the craft-fonts faces. - let deva = vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.has_script("Deva")); + // scripts, which need the craft-fonts faces. A craft-fonts checkout without a Gujarati face (the one + // CI pins) draws the Gujarati name as a box: this test checks where rows stand, not glyph coverage. + let has = |script: &str| vectorcraft_text::CRAFT_FONTS.iter().any(|f| f.has_script(script)); let mut wrong = vec![]; for (name, open, labels, rows, heights) in opens { - if name == "Import Shortcut Set" && !deva { + if name == "Import Shortcut Set" && !has("Deva") { eprintln!("skipped Import Shortcut Set: built without craft-fonts (set CRAFT_FONTS_DIR to a craft-fonts checkout to run it)"); continue; } for &(height, rows_seen) in heights { let screen = Rect::from_min_size(Pos2::ZERO, egui::vec2(1280.0, height)); let mut h = window_in(screen.size()); + if name == "Import Shortcut Set" && !has("Gujr") { + h.ctx.set_missing_glyph_policy(egui::MissingGlyphPolicy::Tofu); + } open(h.state_mut()); for _ in 0..6 { step(&mut h);