From 71dda79330222d10a7bbc859e4953d0bc8f718bc Mon Sep 17 00:00:00 2001 From: David Mann Date: Wed, 28 Oct 2026 23:41:30 +0100 Subject: [PATCH] Web build: ask for the interface language's font when the manifest arrives serve_fonts asks for the interface language's served script font once per language, but the font manifest loads asynchronously: when the first frame ran before it arrived, no fallback was registered yet, the request found nothing, and an Arabic interface on an English browser stayed without its font until the language changed. The manifest load now asks for the interface language's font along with the browser languages'. Review finding on #10006. Co-Authored-By: Claude Opus 5.5 --- apps/photocraft-web/src/web.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/photocraft-web/src/web.rs b/apps/photocraft-web/src/web.rs index 2e9d58fa36..024888c65d 100644 --- a/apps/photocraft-web/src/web.rs +++ b/apps/photocraft-web/src/web.rs @@ -224,7 +224,10 @@ fn load_font_manifest(served: Served, ctx: egui::Context) { served_fonts::add_fonts(&fonts); // Fetch now the fallbacks of the scripts the browser's languages use (an Arabic reader gets // the Arabic font before typing); the rest is fetched when text or a font menu needs it. - served_fonts::request_for_languages(browser_languages().iter().map(String::as_str)); + // Also the interface language's: `serve_fonts` asked for it once already, maybe before + // this manifest arrived, when no fallback was registered yet. + let ui_language = photocraft_ui_egui::i18n::current().code(); + served_fonts::request_for_languages(browser_languages().iter().map(String::as_str).chain([ui_language])); ctx.request_repaint(); }); }