How to make fonts stick on applications like Librewolf/Firefox and Thunderbird


```
System:
Kernel: 6.4.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=dce650f1-f4c4-417c-9d13-d1bbcca3e55e rw rootflags=subvol=@
nvidia-drm.modeset=1 rd.udev.log_priority=3 vt.global_cursor_default=0
loglevel=3
Desktop: KDE Plasma v: 5.27.6 tk: Qt v: 5.15.10 wm: kwin_x11 vt: 2
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop Mobo: ASUSTeK model: ROG STRIX X570-F GAMING v: Rev X.0x
serial: <superuser required> UEFI: American Megatrends v: 4021
date: 08/09/2021
Battery:
Device-1: ps-controller-battery-4c:b9:9b:94:01:9b model: N/A serial: N/A
charge: N/A status: full
CPU:
Info: model: AMD Ryzen 9 3950X bits: 64 type: MT MCP arch: Zen 2 gen: 3
level: v3 note: check built: 2020-22 process: TSMC n7 (7nm)
family: 0x17 (23) model-id: 0x71 (113) stepping: 0 microcode: 0x8701021
Topology: cpus: 1x cores: 16 tpc: 2 threads: 32 smt: enabled cache:
L1: 1024 KiB desc: d-16x32 KiB; i-16x32 KiB L2: 8 MiB desc: 16x512 KiB
L3: 64 MiB desc: 4x16 MiB
Speed (MHz): avg: 4020 high: 4248 min/max: 2200/4761 boost: enabled
scaling: driver: acpi-cpufreq governor: performance cores: 1: 3500 2: 3500
3: 4228 4: 3500 5: 4195 6: 4225 7: 4199 8: 4248 9: 4228 10: 4226 11: 4212
12: 4221 13: 4239 14: 3500 15: 3500 16: 4221 17: 4247 18: 3500 19: 4215
20: 4225 21: 4244 22: 3500 23: 3500 24: 3500 25: 4244 26: 4223 27: 4226
28: 4213 29: 4225 30: 4220 31: 4226 32: 4214 bogomips: 223997
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: NVIDIA GA102 [GeForce RTX 3080 Lite Hash Rate] vendor: Gigabyte
driver: nvidia v: 535.54.03 alternate: nouveau,nvidia_drm non-free: 535.xx+
status: current (as of 2023-07) arch: Ampere code: GAxxx
process: TSMC n7 (7nm) built: 2020-22 pcie: gen: 4 speed: 16 GT/s
lanes: 16 ports: active: none off: DP-1 empty: DP-2, DP-3, HDMI-A-1,
HDMI-A-2 bus-ID: 09:00.0 chip-ID: 10de:2216 class-ID: 0300
Device-2: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.1
speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 4-1:2 chip-ID: 046d:085e
class-ID: 0300 serial: <filter>
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2
compositor: kwin_x11 driver: X: loaded: nvidia gpu: nvidia,nvidia-nvswitch
display-ID: :0 screens: 1
Screen-1: 0 s-res: 5120x1440 s-dpi: 109 s-size: 1193x342mm (46.97x13.46")
s-diag: 1241mm (48.86")
Monitor-1: DP-1 mapped: DP-0 note: disabled model: Philips PHL 498P9Z
serial: <filter> built: 2022 res: 5120x1440 hz: 165 dpi: 130048 gamma: 1.2
size: 1x1mm (0.04x0.04") diag: 1238mm (48.7") modes: max: 3840x1080
min: 640x480
API: OpenGL v: 4.6.0 NVIDIA 535.54.03 renderer: NVIDIA GeForce RTX
3080/PCIe/SSE2 direct-render: Yes
Audio:
Device-1: NVIDIA GA102 High Definition Audio vendor: Gigabyte
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 09:00.1 chip-ID: 10de:1aef class-ID: 0403
Device-2: AMD Starship/Matisse HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 0b:00.4 chip-ID: 1022:1487 class-ID: 0403
Device-3: Nektar Impact GX49 driver: snd-usb-audio type: USB rev: 1.1
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-1:2 chip-ID: 2467:2033
class-ID: 0103
Device-4: Yamaha Steinberg UR22C driver: snd-usb-audio type: USB rev: 2.1
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-2.1:5 chip-ID: 0499:172f
class-ID: 0103
Device-5: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.1
speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 4-1:2 chip-ID: 046d:085e
class-ID: 0300 serial: <filter>
Device-6: Sony DualSense wireless controller (PS5)
driver: playstation,snd-usb-audio,usbhid type: USB rev: 2.0 speed: 480 Mb/s
lanes: 1 mode: 2.0 bus-ID: 5-3.2:8 chip-ID: 054c:0ce6 class-ID: 0300
API: ALSA v: k6.4.3-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
Server-2: PipeWire v: 0.3.74 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Wi-Fi 6 AX210/AX211/AX411 160MHz driver: iwlwifi v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:2725
class-ID: 0280
IF: wlp4s0 state: down mac: <filter>
Device-2: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel
pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: f000 bus-ID: 05:00.0
chip-ID: 8086:1539 class-ID: 0200
IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-3: Sony DualSense wireless controller (PS5)
driver: playstation,snd-usb-audio,usbhid type: USB rev: 2.0 speed: 480 Mb/s
lanes: 1 mode: 2.0 bus-ID: 5-3.2:8 chip-ID: 054c:0ce6 class-ID: 0300
Bluetooth:
Device-1: Realtek Bluetooth 5.1 Radio driver: btusb v: 0.8 type: USB
rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-2:2 chip-ID: 0bda:8771
class-ID: e001 serial: <filter>
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
Local Storage: total: 10.92 TiB used: 753.56 GiB (6.7%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: SSD 980 PRO 2TB
size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
lanes: 4 tech: SSD serial: <filter> fw-rev: 3B2QGXA7 temp: 49.9 C
scheme: GPT
ID-2: /dev/sda maj-min: 8:0 vendor: Seagate model: ST2000DX002-2DV164
size: 1.82 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: HDD rpm: 7200 serial: <filter> fw-rev: CC41 scheme: GPT
ID-3: /dev/sdb maj-min: 8:16 vendor: Seagate model: ST6000DM003-2CY186
size: 5.46 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: HDD rpm: 5425 serial: <filter> fw-rev: 0001 scheme: GPT
ID-4: /dev/sdc maj-min: 8:32 vendor: Samsung model: SSD 850 EVO 1TB
size: 931.51 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 1B6Q scheme: GPT
ID-5: /dev/sdd maj-min: 8:48 vendor: Crucial model: CT1000MX500SSD4
size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 023 scheme: GPT
Partition:
ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%) used: 753.56 GiB (40.5%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 753.56 GiB (40.5%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 753.56 GiB (40.5%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 753.56 GiB (40.5%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 125.7 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 38.0 C mobo: 36.0 C gpu: nvidia temp: 45 C
Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
Processes: 525 Uptime: 4h 13m wakeups: 2 Memory: total: 128 GiB note: est.
available: 125.71 GiB used: 7.49 GiB (6.0%) Init: systemd v: 253
default: graphical tool: systemctl Compilers: gcc: 13.1.1 alt: 12
clang: 15.0.7 Packages: 1864 pm: pacman pkgs: 1859 libs: 511
tools: octopi,paru,yay pm: flatpak pkgs: 5 Shell: fish v: 3.6.1
running-in: konsole inxi: 3.3.28
Garuda (2.6.16-1):
System install date:     2023-07-07
Last full system update: 2023-07-15 ↻
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:
```

So I've noticed that fonts do not commit on applications like Firefox/Librewolf, Thunderbird, etc which I assume at GTK3/4 applications.

I've double-checked the GNOME/GTK Application Style in KDE Application Style which is set to "Sweet Dark".

All of my fonts are set in the KDE fonts section and I'm using "Overpass" as my font.

My .gtkrc-2.0 is:

gtk-enable-animations=1
gtk-primary-button-warps-slider=1
# DO NOT EDIT! This file will be overwritten by LXAppearance.
# Any customization should be done in ~/.gtkrc-2.0.mine instead.

gtk-theme-name="Sweet-Dark"
gtk-icon-theme-name="BeautyLine"
gtk-font-name="Overpass, Demi Bold 10"
gtk-cursor-theme-name="Sweet-cursors"
gtk-cursor-theme-size=24
gtk-toolbar-style=3
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-button-images=1
gtk-menu-images=1
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-xft-antialias=1
gtk-xft-hinting=1
gtk-xft-hintstyle="hintslight"
gtk-xft-rgba="rgb"
gtk-modules="colorreload-gtk-module:window-decorations-gtk-module"

My .config/gtk-4.0/settings.ini is as follows:

[Settings]
gtk-application-prefer-dark-theme=true
gtk-cursor-theme-name=Sweet-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=close,maximize,minimize:
gtk-enable-animations=true
gtk-font-name=Overpass, Demi Bold 10
gtk-icon-theme-name=BeautyLine
gtk-primary-button-warps-slider=true
gtk-theme-name=Sweet-Dark
gtk-xft-dpi=98304

and my ~/.config/gtk-3.0/settings.ini file is:

[Settings]
gtk-application-prefer-dark-theme=true
gtk-button-images=true
gtk-cursor-theme-name=Sweet-cursors
gtk-cursor-theme-size=24
gtk-decoration-layout=close,maximize,minimize:
gtk-enable-animations=true
gtk-enable-event-sounds=1
gtk-enable-input-feedback-sounds=1
gtk-font-name=Overpass, Demi Bold 10
gtk-icon-theme-name=BeautyLine
gtk-menu-images=true
gtk-modules=colorreload-gtk-module:window-decorations-gtk-module
gtk-primary-button-warps-slider=true
gtk-theme-name=Sweet-Dark
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
gtk-toolbar-style=3
gtk-xft-antialias=1
gtk-xft-dpi=98304
gtk-xft-hinting=1
gtk-xft-hintstyle=hintslight
gtk-xft-rgba=rgb

I read through the arch wiki and through here and nothing resolves the problem, even trying to play around with fonts.conf didn't do anything. So I installed lxappearance just to check and this is what appears everytime I reboot the system.

The default font is set to "None". If I change it in LXAppearance it changes the font correctly till I reboot. Any ideas?

The ArchWiki page for Firefox has a note which suggests additional configuration may be needed for fonts. Firefox - ArchWiki

Font troubleshooting

See Font configuration.

Firefox has a setting which determines how many replacements it will allow from Fontconfig. To allow it to use all your replacement rules, change gfx.font_rendering.fontconfig.max_generic_substitutions to 127 (the highest possible value).

Firefox ships with the Twemoji Mozilla font. To use the system emoji font, set font.name-list.emoji to emoji in about:config. Additionally, to prevent the Mozilla font interfering with your system emoji font, change gfx.font_rendering.opentype_svg.enabled to false or remove /usr/lib/firefox/fonts/TwemojiMozilla.ttf (see also pacman#Skip files from being installed to system).

1 Like

Hi BluishHumility,

I tried those settings you suggested and nothing changed.

So I figured out how to get it to fix fonts in Firefox, Thunderbird and other apps correctly.

  1. I copied the fonts required to my local .fonts directory (~/.fonts)
  2. I created a file in ~/.config/fontconfig/local.conf with the following text:
<match target="pattern">
  <test qual="any" name="family"><string>sans-serif</string></test>
  <edit name="family" mode="assign" binding="same"><string>Overpass Semi-Bold</string></edit>
</match>
  1. Type in fc-cache -fv to refresh local font cache.

This now makes sure everytime it finds a "Sans" font to properly use the font I chose in KDE.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.