fix(ui): add Fedora font paths so DejaVu and Liberation load on Fedora (#45)

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.
This commit is contained in:
Royce
2026-10-13 22:50:49 +08:00
parent c0cb993408
commit 0c19777c8a
+4
View File
@@ -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.