mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-12 19:41:10 +00:00
Desktop: name a default font family, and rebuild fontconfig's cache once
Firefox's own network log shows it fully online - DNS answering for both families, sockets connecting, HTTP/2 and HTTP/3 sessions carrying data - so the blank pages were never the network. They are the fonts: Gecko reports 'no fonts' with 13 families found, which is what it says when no generic family resolves to a face. The linked rules map sans-serif onto faces a full distribution installs; this rootfs has DejaVu and nothing else, so local.conf names it outright for every generic, and the cache built into the image is rebuilt once so the new rules are seen.
This commit is contained in:
1 parent
1b3c1cbf86
commit
ce9cf2bdf3
1 file changed
+22
@@ -44,6 +44,28 @@ if [ -d /usr/share/fontconfig/conf.default ] && ! ls /etc/fonts/conf.d/*.conf >/
|
||||
for f in /usr/share/fontconfig/conf.default/*.conf; do ln -sf "$f" /etc/fonts/conf.d/; done
|
||||
echo "== fontconfig: linked $(ls /etc/fonts/conf.d/*.conf | wc -l) default rules"
|
||||
fi
|
||||
# Those rules map sans-serif and friends onto whatever a full distribution installs, and this
|
||||
# rootfs has one family. Naming it outright is what gives every toolkit a default font: without
|
||||
# one Gecko reports "no fonts" with families found, and draws pages with no text at all.
|
||||
if [ ! -f /etc/fonts/local.conf ]; then
|
||||
{ echo '<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"><fontconfig>'
|
||||
for generic in sans-serif sans serif monospace mono cursive fantasy system-ui ui-sans-serif; do
|
||||
case $generic in
|
||||
serif) face="DejaVu Serif" ;;
|
||||
mono*|ui-mono) face="DejaVu Sans Mono" ;;
|
||||
*) face="DejaVu Sans" ;;
|
||||
esac
|
||||
printf '<alias binding="weak"><family>%s</family><prefer><family>%s</family></prefer></alias>\n' "$generic" "$face"
|
||||
done
|
||||
echo '</fontconfig>'
|
||||
} > /etc/fonts/local.conf
|
||||
echo "== fontconfig: wrote local.conf (DejaVu as the default family)"
|
||||
fi
|
||||
# The cache in the image was built before those rules existed; rebuild it once, and only once.
|
||||
if [ ! -f /var/cache/fontconfig/.steamdeck-built ] && command -v fc-cache >/dev/null 2>&1; then
|
||||
fc-cache -f >/dev/null 2>&1 && touch /var/cache/fontconfig/.steamdeck-built
|
||||
echo "== fontconfig: cache rebuilt, default sans is $(fc-match sans-serif 2>/dev/null)"
|
||||
fi
|
||||
echo "== steamdeck-desktop: labwc ($WLR_RENDERER) on $WAYLAND_DISPLAY"
|
||||
# ~/.steamdeck-desktop-debug: labwc's own debug log (views and layer surfaces mapping) too.
|
||||
DEBUG=; [ -f "$HOME/.steamdeck-desktop-debug" ] && DEBUG=-d
|
||||
|
||||
Reference in new issue
Block a user