From 0168d25d8558232dc005c712e9f21304a369ceb3 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 24 Oct 2026 13:04:14 +0700 Subject: [PATCH] #1026: the intensity-width test skips labels egui's own font can't draw --- crates/ui-egui/src/field_tests.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/ui-egui/src/field_tests.rs b/crates/ui-egui/src/field_tests.rs index dd63988a..0f3d7a91 100644 --- a/crates/ui-egui/src/field_tests.rs +++ b/crates/ui-egui/src/field_tests.rs @@ -577,6 +577,11 @@ fn the_intensity_label_fits_whole_in_every_language() { let label = lang.ui.iter().find(|(k, _)| *k == "Intensity").map_or("Intensity", |(_, t)| match t { Text::Plain(s) | Text::Plural { other: s, .. } => s, }); + // The test's context has only egui's own font: a label it can't draw (Vietnamese + // diacritics, CJK) can't be measured here, and the app draws it with a system font. + if !ui.ctx().fonts_mut(|f| f.has_glyphs(&crate::theme::regular(11.0), label)) { + continue; + } let lead = crate::widgets::text_lead_width(ui, label, GLASS_FIELD_W); assert!(lead >= 12.0 + width(label), "{}: {label:?} would end in \"…\"", lang.code); }