From bf30e57186b09163eb41ad869467c6a28eccc746 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 18 Jun 2026 13:34:03 +0300 Subject: [PATCH] fix(web): force Advanced shaping for dynamic-input canvas text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dynamic-input value boxes, the prompt pill and the UCS axis labels are drawn with `frame.fill_text`, whose `canvas::Text` defaults to `Shaping::Auto`. Auto picks Basic shaping for ASCII-only strings, which renders on desktop but draws nothing on the web (wgpu/webgl) backend, so the all-digit distance/coordinate boxes and X/Y/Z labels were blank (the angle box rendered only because its `°` upgraded it to Advanced). Typed values landed correctly but were invisible. (#117) Set `shaping: Advanced` on every canvas fill_text in the overlay. Co-Authored-By: Claude Opus 4.8 --- src/ui/overlay.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ui/overlay.rs b/src/ui/overlay.rs index 552fe6310..d4f14cff1 100644 --- a/src/ui/overlay.rs +++ b/src/ui/overlay.rs @@ -1171,6 +1171,7 @@ fn draw_ucs_icon(frame: &mut canvas::Frame, vp: Mat4, bounds: iced::Rectangle) { position: Point::new(tip.x + nx * 8.0 - 3.5, tip.y + ny * 8.0 - 5.0), color: col, size: iced::Pixels(10.0), + shaping: iced::advanced::text::Shaping::Advanced, ..Default::default() }); } @@ -1285,6 +1286,11 @@ impl DynInputCanvas { position: Point { x: x + DYN_PAD, y: y + DYN_PAD }, color: Color { r: 0.92, g: 0.92, b: 0.92, a: 1.0 }, size: iced::Pixels(DYN_FONT), + // Force Advanced shaping: the default `Auto` uses Basic shaping for + // ASCII-only strings, which the web (wgpu/webgl) backend fails to + // render — so all-digit value boxes came up blank while the angle + // box (containing the non-ASCII `°`) rendered. (#117) + shaping: iced::advanced::text::Shaping::Advanced, ..Default::default() }); } @@ -1327,6 +1333,7 @@ impl DynInputCanvas { position: Point { x: pos.x + DYN_PAD, y: pos.y + DYN_PAD }, color: Color { r: 0.70, g: 0.85, b: 0.70, a: 1.0 }, size: iced::Pixels(DYN_FONT), + shaping: iced::advanced::text::Shaping::Advanced, ..Default::default() }); } @@ -1562,6 +1569,7 @@ impl DynInputCanvas { position: Point { x: x + DYN_PAD, y: by + DYN_PAD }, color: Color { r: 0.92, g: 0.92, b: 0.92, a: 1.0 }, size: iced::Pixels(DYN_FONT), + shaping: iced::advanced::text::Shaping::Advanced, ..Default::default() }); x += w + DYN_GAP;