From 0c19777c8a90a86fffc4146323fc0597307c644d Mon Sep 17 00:00:00 2001 From: Royce Date: Tue, 13 Oct 2026 22:50:49 +0800 Subject: [PATCH] fix(ui): add Fedora font paths so DejaVu and Liberation load on Fedora (#45) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Linux font search list in `crates/ui-egui/src/fonts.rs` covered Debian/Ubuntu (`/usr/share/fonts/truetype/dejavu`, `/usr/share/fonts/TTF`, `/usr/share/fonts/dejavu`) and Arch (`/usr/local/share/fonts/dejavu`) for DejaVu, and a single path for Liberation Sans. It did not cover Fedora's package layout: - `/usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf` (and -Bold) - `/usr/share/fonts/liberation-sans-fonts/LiberationSans-Regular.ttf` On Fedora, neither path matched, the `load_from_fontconfig` path returned None (e.g. the user only has Liberation Sans installed, not DejaVu), and the UI fell back to egui's built-in fonts. Those don't cover the menu glyphs (`→ ▸ ▾ ♯ ✕`), so the symbols showed as empty boxes. Add the two Fedora paths to the REGULAR and BOLD candidates, in the same order as the existing Debian and Arch paths. `load` still tries fontconfig first; the direct paths are the fallback. cargo test -p soundcraft-ui-egui: 105 passed, 0 failed. --- crates/ui-egui/src/fonts.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/fonts.rs b/crates/ui-egui/src/fonts.rs index 46d50bae..ae185834 100644 --- a/crates/ui-egui/src/fonts.rs +++ b/crates/ui-egui/src/fonts.rs @@ -12,8 +12,10 @@ const REGULAR: &[(&str, u32)] = &[ ("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 0), ("/usr/share/fonts/TTF/DejaVuSans.ttf", 0), ("/usr/share/fonts/dejavu/DejaVuSans.ttf", 0), + ("/usr/share/fonts/dejavu-sans-fonts/DejaVuSans.ttf", 0), ("/usr/local/share/fonts/dejavu/DejaVuSans.ttf", 0), ("/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf", 0), + ("/usr/share/fonts/liberation-sans-fonts/LiberationSans-Regular.ttf", 0), ]; const BOLD: &[(&str, u32)] = &[ ("/System/Library/Fonts/HelveticaNeue.ttc", 1), @@ -22,8 +24,10 @@ const BOLD: &[(&str, u32)] = &[ ("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 0), ("/usr/share/fonts/TTF/DejaVuSans-Bold.ttf", 0), ("/usr/share/fonts/dejavu/DejaVuSans-Bold.ttf", 0), + ("/usr/share/fonts/dejavu-sans-fonts/DejaVuSans-Bold.ttf", 0), ("/usr/local/share/fonts/dejavu/DejaVuSans-Bold.ttf", 0), ("/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf", 0), + ("/usr/share/fonts/liberation-sans-fonts/LiberationSans-Bold.ttf", 0), ]; /// Hangul fallback, appended after every family so Korean session, track and clip names draw /// whatever the interface language. The Noto Sans CJK collection's face 1 is its Korean face.