#874: scan Flatpak host, XDG and fontconfig font folders on Linux
Problem: on Linux the font list only scanned /usr/share/fonts, /usr/local/share/fonts, ~/.local/share/fonts and ~/.fonts. The ArtCraft Launcher installs EffectCraft as a Flatpak, where those folders hold only the runtime's fonts and the host's fonts live under /run/host, so installed fonts were missing (25 families instead of 320 on the reporter's setup). $XDG_DATA_HOME/fonts, $XDG_DATA_DIRS/*/fonts and fontconfig <dir> entries were never scanned either. Fix: a new font_dirs module lists the usual folders, the Flatpak host folders (/run/host/fonts, local-fonts, user-fonts), the XDG data folders and the <dir>/<remap-dir> entries of the fontconfig configuration (FONTCONFIG_FILE or /etc/fonts/fonts.conf, /usr/local/etc/fonts/fonts.conf, and ~/.config/fontconfig), following <include>s with prefix="xdg", "relative" and ~ expansion. It uses a small tag scanner (no new dependency), bounds the include depth, the number and size of files read, and reads each file once. Folders are deduplicated before the walk, and the walk depth goes from 4 to 8. docs/agents.md lists the folders and how to grant the Flatpak an extra one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
67434e9038
commit
b58197ff82
@@ -7,6 +7,8 @@
|
||||
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), not(target_arch = "wasm32")))]
|
||||
mod font_dirs;
|
||||
pub mod fonts;
|
||||
pub mod layout;
|
||||
pub mod path_text;
|
||||
|
||||
Reference in New Issue
Block a user