From e8b0fa5bd9e83001a82d6501eb39519a71caacdf Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Wed, 17 Jun 2026 13:38:05 -0500 Subject: Fix bundled font fallback --- docker/Dockerfile | 1 + docker/build-inner.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 58 insertions(+), 4 deletions(-) (limited to 'docker') diff --git a/docker/Dockerfile b/docker/Dockerfile index 376f711..a2c0f67 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,6 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # Build essentials build-essential cmake meson ninja-build ccache \ git curl wget file binutils patchelf pkg-config ca-certificates \ + fonts-dejavu-core \ # Library dependencies libboost-all-dev \ libsqlite3-dev \ diff --git a/docker/build-inner.sh b/docker/build-inner.sh index 135ffff..5c14fce 100755 --- a/docker/build-inner.sh +++ b/docker/build-inner.sh @@ -57,6 +57,33 @@ OUT_DIR="/src/build/staging" rm -rf "${OUT_DIR}" mkdir -p "${OUT_DIR}/plugins" "${OUT_DIR}/lib" +# ── Bundled fallback fonts ── +# The release uses a minimal fontconfig file so bundled fontconfig doesn't try +# to parse newer host configs. Ship a known Latin UI font so that generic +# families don't resolve to symbol-only fonts on hosts like Fedora/Bazzite. +mkdir -p "${OUT_DIR}/fonts" "${OUT_DIR}/licenses" +DEJAVU_DIR="" +for candidate in \ + /usr/share/fonts/truetype/dejavu \ + /usr/share/fonts/dejavu \ + /usr/share/fonts/TTF; do + if [ -f "${candidate}/DejaVuSans.ttf" ]; then + DEJAVU_DIR="${candidate}" + break + fi +done +if [ -z "${DEJAVU_DIR}" ]; then + echo "ERROR: DejaVu Sans font not found in build container" + exit 1 +fi +for font in DejaVuSans.ttf DejaVuSans-Bold.ttf DejaVuSansMono.ttf DejaVuSansMono-Bold.ttf; do + cp -f "${DEJAVU_DIR}/${font}" "${OUT_DIR}/fonts/" +done +if [ -f /usr/share/doc/fonts-dejavu-core/copyright ]; then + cp -f /usr/share/doc/fonts-dejavu-core/copyright \ + "${OUT_DIR}/licenses/fonts-dejavu-core.txt" +fi + # ── Main binary + helpers ── cp -f "${RUNDIR}/ModOrganizer" "${OUT_DIR}/ModOrganizer-core" [ -f "${RUNDIR}/README-PORTABLE.txt" ] && cp -f "${RUNDIR}/README-PORTABLE.txt" "${OUT_DIR}/" @@ -616,19 +643,45 @@ export QT_QPA_PLATFORM_PLUGIN_PATH="${RUN}/qt6plugins/platforms" # newer /etc/fonts configuration, older bundled fontconfig can warn on syntax # like xsi:nil and newer generic families. Use a minimal compatible config for # Fluorine itself; launched games/tools restore the user's original env. -mkdir -p "${RUN}/etc/fonts" -cat > "${RUN}/etc/fonts/fonts.conf" < "${RUN}/etc/fonts/fonts.conf" < + ${RUN}/fonts /usr/share/fonts /usr/local/share/fonts fonts fontconfig + + + sans-serif + DejaVu Sans + + + monospace + DejaVu Sans Mono + + + MS Shell Dlg 2 + DejaVu Sans + + + Segoe UI + DejaVu Sans + + + Arial + DejaVu Sans + EOF -export FONTCONFIG_FILE="${RUN}/etc/fonts/fonts.conf" -export FONTCONFIG_PATH="${RUN}/etc/fonts" + export FONTCONFIG_FILE="${RUN}/etc/fonts/fonts.conf" + export FONTCONFIG_PATH="${RUN}/etc/fonts" +else + unset FONTCONFIG_FILE FONTCONFIG_PATH +fi # Raise open file descriptor limit — large modlists with FUSE VFS # can easily exceed the default 1024 -- cgit v1.3.1