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.
This commit is contained in:
dotCooCoo
2026-11-30 07:17:43 -08:00
parent 57064e21c3
commit 9b4e6366cb
+7 -3
View File
@@ -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);