diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 2ac33be17..eb7e815c7 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -2281,10 +2281,18 @@ fn draw_viewcube(app: &mut CadApp, ui: &mut egui::Ui, rect: Rect) { let (c, ring) = (l.center, l.ring); let p = ui.painter_at(rect); crate::viewcube::show(app, ui, &l); - // WCS pill. + // WCS pill: the label and a down chevron, drawn as lines rather than a "⌄" glyph that a UI + // font may lack (it showed as a box, #1541). let pill = Rect::from_center_size(c + vec2(0.0, ring + 26.0), vec2(56.0, 16.0)); p.rect_filled(pill, 8.0, Color32::from_rgb(0x48, 0x50, 0x5c)); - p.text(pill.center(), egui::Align2::CENTER_CENTER, crate::tl!("WCS ⌄"), crate::theme::small(), Tokens::DARK.canvas_ink); + let ink = Tokens::DARK.canvas_ink; + let label = p.layout_no_wrap(crate::tl!("WCS").to_string(), crate::theme::small(), ink); + let (gap, chevron) = (4.0, 6.0); + let left = pill.center().x - (label.size().x + gap + chevron) / 2.0; + let mid = pill.center().y; + p.galley(pos2(left, mid - label.size().y / 2.0), label.clone(), ink); + let x = left + label.size().x + gap; + p.line(vec![pos2(x, mid - 1.5), pos2(x + chevron / 2.0, mid + 1.5), pos2(x + chevron, mid - 1.5)], Stroke::new(1.2, ink)); } /// A click on grip `g` (idle): Shift+click makes it hot or cold again; a plain click starts diff --git a/crates/ui-egui/src/i18n/ar.tsv b/crates/ui-egui/src/i18n/ar.tsv index dd250520c..6400a1f38 100644 --- a/crates/ui-egui/src/i18n/ar.tsv +++ b/crates/ui-egui/src/i18n/ar.tsv @@ -1192,7 +1192,7 @@ Viewport {id} إطار العرض {id} Viewports منافذ عرض Volume مستوى الصوت - WCS ⌄ WCS ⌄ + WCS WCS White أبيض Width factor معامل العرض Window نافذة diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 1c94d73f6..fd8f6bf17 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1139,7 +1139,7 @@ Viewport {id} Výřez {id} Viewports Výřezy W Z - WCS ⌄ GSS ⌄ + WCS GSS White Bílá Width factor Faktor šířky Window Okno diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index bd1f77dac..d1b6cf23f 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -968,7 +968,7 @@ Viewport {id} Ansichtsfenster {id} Viewports Ansichtsfenster W W - WCS ⌄ WKS ⌄ + WCS WKS White Weiß Width factor Breitenfaktor Window Fenster diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index f4ad00852..9aaa2722a 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1177,7 +1177,7 @@ Viewports Ventanas gráficas Volume Volumen W O - WCS ⌄ SCU ⌄ + WCS SCU White Blanco Width factor Factor de anchura Window Ventana diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index eeb6a216b..7bee67720 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -962,7 +962,7 @@ Viewport {id} Fenêtre {id} Viewports Fenêtres W O - WCS ⌄ SCG ⌄ + WCS SCG White Blanc Width factor Facteur de largeur Window Fenêtre diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index d95d32355..b5fbecaf2 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1142,7 +1142,7 @@ menu Modify Edita Viewport {id} Finestra {id} Viewports Finestre W O - WCS ⌄ WCS ⌄ + WCS WCS White Bianco Width factor Fattore di larghezza Window Finestra diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index d60c7e19e..8b7b016fe 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -1138,7 +1138,7 @@ Viewport {id} 뷰포트 {id} Viewports 뷰포트 W 서 - WCS ⌄ WCS 선택 + WCS WCS White 흰색 Width factor 폭 비율 Window 창 diff --git a/crates/ui-egui/src/i18n/pt_br.tsv b/crates/ui-egui/src/i18n/pt_br.tsv index fe60e5a7c..37e696330 100644 --- a/crates/ui-egui/src/i18n/pt_br.tsv +++ b/crates/ui-egui/src/i18n/pt_br.tsv @@ -1177,7 +1177,7 @@ Viewports Viewports Volume Volume W O - WCS ⌄ SCM ⌄ + WCS SCM White Branco Width factor Fator de largura Window Janela diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index f6b1ae731..86911a32d 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -962,7 +962,7 @@ Viewport {id} Видовой экран {id} Viewports Видовые экраны W З - WCS ⌄ МСК ⌄ + WCS МСК White Белый Width factor Коэффициент ширины Window Окно diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 8a2e5ebdb..a283193f8 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -1176,7 +1176,7 @@ Viewports Vyfönster Volume Volym W V - WCS ⌄ WCS ⌄ + WCS WCS White Vit Width factor Breddfaktor Window Fönster diff --git a/crates/ui-egui/src/i18n/tests.rs b/crates/ui-egui/src/i18n/tests.rs index 36a610155..12cf4fc6c 100644 --- a/crates/ui-egui/src/i18n/tests.rs +++ b/crates/ui-egui/src/i18n/tests.rs @@ -271,6 +271,36 @@ fn live_switch_to_brazilian_portuguese_translates_the_shell() { assert!(render(&mut app, &ctx).contains("Properties")); } +#[test] +fn the_wcs_pill_draws_its_arrow_instead_of_a_glyph_a_font_may_lack() { + // #1541: "WCS ⌄" showed a box where the UI font had no "⌄"; the chevron is now drawn as + // lines, so no catalog and no language paints the glyph. + for (name, catalog) in [ + ("ar", include_str!("ar.tsv")), + ("cs", include_str!("cs.tsv")), + ("de", include_str!("de.tsv")), + ("es", include_str!("es.tsv")), + ("fr", include_str!("fr.tsv")), + ("it", include_str!("it.tsv")), + ("ko", include_str!("ko.tsv")), + ("pt_br", include_str!("pt_br.tsv")), + ("ru", include_str!("ru.tsv")), + ("sv", include_str!("sv.tsv")), + ("uk", include_str!("uk.tsv")), + ("zh", include_str!("zh.tsv")), + ] { + assert!(!catalog.contains('\u{2304}'), "{name}.tsv still has the \u{2304} glyph"); + } + let ctx = egui::Context::default(); + let mut app = CadApp::new(Session::new(), Services::default()); + for (lang, label) in [("en", "WCS"), ("de", "WKS"), ("ru", "МСК")] { + app.run("ui.language", json!({ "lang": lang })).unwrap(); + let text = render(&mut app, &ctx); + assert!(text.lines().any(|l| l == label), "{lang}: the pill reads {label}"); + assert!(!text.contains('\u{2304}'), "{lang}: no \u{2304} glyph is painted"); + } +} + fn painted_text(shapes: &[egui::epaint::ClippedShape]) -> String { fn collect(shape: &egui::Shape, text: &mut String) { match shape { @@ -621,7 +651,7 @@ fn korean_representative_translations_remain_available() { ("", "Properties", "특성"), ("", "Degree", "도 기호"), ("", "Style: Standard", "스타일: Standard"), - ("", "WCS ⌄", "WCS 선택"), + ("", "WCS", "WCS"), ("@plural", "{n} contributor", "기여자 {n}명"), ("@plural", "{n} commit", "커밋 {n}개"), ] { diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index f6a47bace..b6e4f1405 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1179,7 +1179,7 @@ Viewport {id} Видовий екран {id} Viewports Видові екрани W Зх - WCS ⌄ ССК ⌄ + WCS ССК White Білий Width factor Коефіцієнт ширини Window Вікно diff --git a/crates/ui-egui/src/i18n/zh.tsv b/crates/ui-egui/src/i18n/zh.tsv index af691a841..ff98ffb84 100644 --- a/crates/ui-egui/src/i18n/zh.tsv +++ b/crates/ui-egui/src/i18n/zh.tsv @@ -963,7 +963,7 @@ Viewport {id} 视口 {id} Viewports 视口 W W - WCS ⌄ WCS ⌄ + WCS WCS White 白色 Width factor 宽度因子 Window 窗口