Electron is randomly killing my bitmap fonts against my will

This is a very strange and annoying issue I am having. My system is randomly (or at least I haven’t figured out what triggers this yet) removing fonts from my cache. I’m using a bitmap font in Alacritty and all of a sudden when I least expect it… I open a terminal a the font is wrong. If I grep fc-list at that point, the font I was using is removed from my system. I can get it back with fc-cache --force but this is really stupid.

I am not sure if this is happening to other fonts or only to new bitmap fonts I install, but I have only noticed it with the new bitmap fonts because it keeps killing the one I am using with Alacritty.

Does anyone know what on earth would cause this? I have already tried sym linking 70-yes-bitmaps.conf in fontconfig, but even before that it had no issue with installing bitmap fonts… probably because it already had 10-scale-bitmap-fonts And they persist through reboots just fine. I just can’t figure out what the pattern is.

KDE Dr460ized Gaming Edition, X11 session.

System:
Kernel: 6.8.4-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc avail: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=e47b5a22-506c-4573-b60f-520b613f7533 rw rootflags=subvol=@
splash rd.udev.log_priority=3 vt.global_cursor_default=0 loglevel=3
drm.edid_firmware=DisplayPort-0:/edid/Samsung-EDID-RGB.bin intel_iommu=on
iommu=pt vfio-pci.ids=10de:1d01,10de:0fb8 plymouth.enable=0
disablehooks=plymouth ibt=off
Desktop: KDE Plasma v: 6.0.3 tk: Qt v: N/A info: frameworks v: 6.0.0
wm: kwin_x11 tools: avail: xscreensaver vt: 2 dm: SDDM Distro: Garuda
base: Arch Linux
Machine:
Type: Desktop System: Gigabyte product: Z690 AERO D v: -CF
serial: <superuser required>
Mobo: Gigabyte model: Z690 AERO D serial: <superuser required>
uuid: <superuser required> UEFI: American Megatrends LLC. v: F28
date: 12/14/2023
CPU:
Info: model: 13th Gen Intel Core i7-13700K bits: 64 type: MST AMCP
arch: Raptor Lake gen: core 13 level: v3 note: check built: 2022+
process: Intel 7 (10nm) family: 6 model-id: 0xB7 (183) stepping: 1
microcode: 0x122
Topology: cpus: 1x cores: 16 mt: 8 tpc: 2 st: 8 threads: 24 smt: enabled
cache: L1: 1.4 MiB desc: d-8x32 KiB, 8x48 KiB; i-8x32 KiB, 8x64 KiB
L2: 24 MiB desc: 8x2 MiB, 2x4 MiB L3: 30 MiB desc: 1x30 MiB
Speed (MHz): avg: 3246 high: 5300 min/max: 800/5300:5400:4200 scaling:
driver: intel_pstate governor: powersave cores: 1: 5300 2: 800 3: 5161
4: 800 5: 5300 6: 800 7: 5300 8: 800 9: 800 10: 5300 11: 5300 12: 800
13: 4354 14: 800 15: 5300 16: 800 17: 4197 18: 4205 19: 4206 20: 4199
21: 4203 22: 4201 23: 4196 24: 800 bogomips: 164044
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Navi 21 [Radeon RX 6950 XT] vendor: XFX driver: amdgpu
v: kernel arch: RDNA-2 code: Navi-2x process: TSMC n7 (7nm) built: 2020-22
pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: DP-1,DP-2
empty: DP-3,HDMI-A-1,Writeback-1 bus-ID: 03:00.0 chip-ID: 1002:73a5
class-ID: 0300
Device-2: NVIDIA GP108 [GeForce GT 1030] vendor: Micro-Star MSI
driver: vfio-pci v: N/A alternate: nouveau non-free: 545.xx+ status: current
(as of 2024-02; EOL~2026-12-xx) arch: Pascal code: GP10x
process: TSMC 16nm built: 2016-2021 pcie: gen: 1 speed: 2.5 GT/s lanes: 4
link-max: gen: 3 speed: 8 GT/s bus-ID: 04:00.0 chip-ID: 10de:1d01
class-ID: 0300
Device-3: Razer USA Gaming Webcam [Kiyo] driver: snd-usb-audio,uvcvideo
type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-4.1:7
chip-ID: 1532:0e03 class-ID: 0102
Device-4: MacroSilicon USB Video
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-4.4:9 chip-ID: 534d:2109
class-ID: 0300
Device-5: Elgato Systems GmbH Game Capture HD60 X
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.0
speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 2-2.1:4
chip-ID: 0fd9:0082 class-ID: 0300 serial: <filter>
Device-6: AVerMedia USB Device driver: snd-usb-audio,uvcvideo type: USB
rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 2-3.2:8
chip-ID: 07ca:0110 class-ID: 0102 serial: <filter>
Display: x11 server: X.Org v: 21.1.12 with: Xwayland v: 23.2.6
compositor: kwin_x11 driver: X: loaded: amdgpu unloaded: modesetting,radeon
alternate: fbdev,vesa dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 4480x2160 s-dpi: 96 s-size: 1184x571mm (46.61x22.48")
s-diag: 1314mm (51.75")
Monitor-1: DP-1 mapped: DisplayPort-0 pos: primary,top-left model: Samsung
serial: <filter> built: 2021 res: 3840x2160 hz: 60 dpi: 52 gamma: 1.2
size: 1872x1053mm (73.7x41.46") diag: 801mm (31.5") ratio: 16:9 modes:
max: 3840x2160 min: 720x400
Monitor-2: DP-2 mapped: DisplayPort-1 pos: bottom-r model: DP2VGA V221
built: 2015 res: 640x240 hz: 60 dpi: 64 gamma: 1.2
size: 256x192mm (10.08x7.56") diag: 690mm (27.2") ratio: 16:9 modes:
max: 1024x768 min: 640x480
API: EGL v: 1.5 hw: drv: amd radeonsi platforms: device: 0 drv: radeonsi
device: 1 drv: swrast surfaceless: drv: radeonsi x11: drv: radeonsi
inactive: gbm,wayland
API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 24.0.4-arch1.2
glx-v: 1.4 direct-render: yes renderer: AMD Radeon RX 6950 XT (radeonsi
navi21 LLVM 17.0.6 DRM 3.57 6.8.4-zen1-1-zen) device-ID: 1002:73a5
memory: 15.62 GiB unified: no
API: Vulkan v: 1.3.279 layers: 13 device: 0 type: discrete-gpu name: AMD
Radeon RX 6950 XT (RADV NAVI21) driver: mesa radv v: 24.0.4-arch1.2
device-ID: 1002:73a5 surfaces: xcb,xlib device: 1 type: cpu name: llvmpipe
(LLVM 17.0.6 256 bits) driver: mesa llvmpipe v: 24.0.4-arch1.2 (LLVM
17.0.6) device-ID: 10005:0000 surfaces: xcb,xlib
Audio:
Device-1: Intel Alder Lake-S HD Audio vendor: Gigabyte driver: snd_hda_intel
v: kernel alternate: snd_sof_pci_intel_tgl bus-ID: 00:1f.3
chip-ID: 8086:7ad0 class-ID: 0403
Device-2: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel v: kernel
pcie: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 03:00.1 chip-ID: 1002:ab28
class-ID: 0403
Device-3: NVIDIA GP108 High Definition Audio vendor: Micro-Star MSI
driver: vfio-pci alternate: snd_hda_intel pcie: speed: Unknown lanes: 63
link-max: gen: 6 speed: 64 GT/s bus-ID: 04:00.1 chip-ID: 10de:0fb8
class-ID: 0403
Device-4: PreSonus Audio AudioBox USB driver: snd-usb-audio type: USB
rev: 1.1 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-12.3:18
chip-ID: 194f:0302 class-ID: 0103
Device-5: Giga-Byte USB Audio driver: hid-generic,snd-usb-audio,usbhid
type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-2:2
chip-ID: 0414:a00b class-ID: 0300
Device-6: Razer USA Gaming Webcam [Kiyo] driver: snd-usb-audio,uvcvideo
type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-4.1:7
chip-ID: 1532:0e03 class-ID: 0102
Device-7: MacroSilicon USB Video
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-4.4:9 chip-ID: 534d:2109
class-ID: 0300
Device-8: Emagic Soft- und Hardware GmbH Unitor8 driver: snd-usb-audio
type: USB rev: 1.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-8.4.2:23
chip-ID: 086a:0001 class-ID: ff00
Device-9: Elgato Systems GmbH Game Capture HD60 X
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB rev: 3.0
speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 2-2.1:4
chip-ID: 0fd9:0082 class-ID: 0300 serial: <filter>
Device-10: AVerMedia USB Device driver: snd-usb-audio,uvcvideo type: USB
rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 2-3.2:8
chip-ID: 07ca:0110 class-ID: 0102 serial: <filter>
API: ALSA v: k6.8.4-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: PipeWire v: 1.0.4 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 Alder Lake-S PCH CNVi WiFi driver: iwlwifi v: kernel
bus-ID: 00:14.3 chip-ID: 8086:7af0 class-ID: 0280
IF: wlo1 state: up mac: <filter>
Device-2: Aquantia AQC113C NBase-T/IEEE 802.3an Ethernet [Marvell
Scalable mGig] vendor: Gigabyte driver: atlantic v: kernel pcie: gen: 3
speed: 8 GT/s lanes: 2 port: N/A bus-ID: 09:00.0 chip-ID: 1d6a:14c0
class-ID: 0200 temp: 46.0 C
IF: enp9s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Device-3: Intel Ethernet I225-V vendor: Gigabyte driver: igc v: kernel
pcie: gen: 2 speed: 5 GT/s lanes: 1 port: N/A bus-ID: 0a:00.0
chip-ID: 8086:15f3 class-ID: 0200
IF: enp10s0 state: down mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Info: services: NetworkManager, smbd, sshd, systemd-timesyncd,
wpa_supplicant
Bluetooth:
Device-1: Intel AX211 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-14:21 chip-ID: 8087:0033
class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 5.3
lmp-v: 12 status: discoverable: no pairing: no class-ID: 6c0104
Drives:
Local Storage: total: 13.88 TiB used: 2.37 TiB (17.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Western Digital
model: WD BLACK SN850X 2000GB 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: 620331WD temp: 57.9 C scheme: GPT
ID-2: /dev/nvme1n1 maj-min: 259:4 vendor: Western Digital
model: WD BLACK SN770 1TB size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 731100WD temp: 54.9 C scheme: GPT
ID-3: /dev/nvme2n1 maj-min: 259:3 vendor: Western Digital
model: WD BLACK SN770 1TB size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 731100WD temp: 57.9 C scheme: GPT
ID-4: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 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: 2B6Q scheme: GPT
ID-5: /dev/sdb maj-min: 8:16 vendor: HGST (Hitachi) model: HUS724040ALA640
size: 3.64 TiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: HDD rpm: 7200 serial: <filter> fw-rev: AA70 scheme: GPT
ID-6: /dev/sdc maj-min: 8:32 vendor: SanDisk model: X110 2.5 7MM 256GB
size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 412 scheme: GPT
ID-7: /dev/sdd maj-min: 8:48 vendor: Seagate model: ST2000DM008-2FR102
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: 0001 scheme: GPT
ID-8: /dev/sde maj-min: 8:64 vendor: HGST (Hitachi) model: HMS5C4040BLE640
size: 3.64 TiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: HDD rpm: 5700 serial: <filter> fw-rev: A5D0 scheme: GPT
Partition:
ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%) used: 1.32 TiB (72.6%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 2.1 MiB (0.7%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
used: 1.32 TiB (72.6%) 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: 1.32 TiB (72.6%) 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: 1.32 TiB (72.6%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 62.62 GiB used: 381.2 MiB (0.6%)
priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 24
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 44.0 C mobo: N/A gpu: amdgpu temp: 48.0 C
mem: 52.0 C
Fan Speeds (rpm): N/A gpu: amdgpu fan: 0
Info:
Memory: total: 64 GiB note: est. available: 62.62 GiB used: 6.54 GiB (10.5%)
Processes: 547 Power: uptime: 6m states: freeze,mem,disk suspend: deep
avail: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
suspend, test_resume image: 25.01 GiB services: org_kde_powerdevil,
power-profiles-daemon, upowerd Init: systemd v: 255 default: graphical
tool: systemctl
Packages: pm: pacman pkgs: 2403 libs: 619 tools: octopi,paru,yay
Compilers: clang: 17.0.6 gcc: 13.2.1 Shell: garuda-inxi default: Bash
v: 5.2.26 running-in: konsole inxi: 3.3.33
Garuda (2.6.24-1):
System install date:     2023-05-03
Last full system update: 2024-04-09
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut
Windows dual boot:       No/Undetected
Failed units:

Update:

I figured out what is doing this… it’s Electron.

I uninstalled all my Electron apps. The only one I really need is Upscayl, which is using the latest Electron, and it doesn’t seem to kill my fonts.

Caprine on the other hand… I finally figured out just starting it would wipe out my fonts. It’s using an old Electron, 27. I submitted a bug on their github. I barely use facebook messenger anyway, so I’ll just use the website when I need to.

Well this is a bigger problem than I thought. I discovered opening Discord is also deleting my fonts. I guess it uses Electron too but it must be baked in.

This is really intolerable. I’m not even sure where to report this since I can’t confirm which version of Electron do it.

Is there any way to block apps from being able to alter your font cache?

Which one?

or the content of the .local/share/fonts/ folder?

Copy any fonts (.ttf, .otf) into ~/.local/share/fonts and run

fc-cache -fv

Btw, IDK about this bitmap font :slight_smile:

Yes, I can always get them back with fc-cache -fv, but it’s still infuriating. Stupid Electron apps shouldn’t be allowed to remove your fonts!!!

BUT… I think I’ve eliminated all the programs that do this nonsense… MAYBE. It kept happening after I thought it was all resolved. But it’s been a couple hours now and I still have my fonts…

The solution for Discord was to dump the normal packages (discord, discord-ptb, and discord-canary) and install the AUR discord_arch_electron package instead which lets you use the newest electron package.

So far my theory is that the bitmap font massacre only happens on versions of Electron older than 29.

Check

or open a new issue there.

1 Like

I did search there and did not find anything. However I did find this for some other Electron app:

So it does look like it was fixed, even if it wasn’t reported on Electron itself. At least I hope so.

I think at this point it’s better to report the bug to the downstream apps that are still using old versions of Electron… and try to get them to update to 29 or newer. I wish there were more packages that use your system Electron library instead of building in some random old version of it.

1 Like

Time for an update…

Actually… I don’t think it’s fixed at all. There is some unknown thing that Electron apps can do, which triggers the horribly violating thing where you get your bitmap fonts murdered right in front of you. Some apps do this, others don’t. It’s infuriating, and no one seems to care because not enough people still use bitmap fonts.

However I found a solution that does work to stop it from happening with known apps. What worked for me was to install firejail and use a wrapper script for the offending apps. For example, Cider is another offensive app:

File: /usr/bin/cider
#!/bin/sh

# Full path to the private directory
PRIVATE_DIR="/home/serqetry/firejail"

# Application path
APP_PATH="/opt/Cider/cider"

# Run the application in Firejail
firejail --private="$PRIVATE_DIR" --noprofile "$APP_PATH" "$@" || {
echo "Error: Firejail failed to start."
exit 1
}

exit 0

I also set up a cron job every 5 mins that checks if my fonts still exist, and if not does a notify-send to tell me and reruns fc-cach -f. Then I know what the offending app is, and I can make another firejail wrapper for it. Electron is a plague upon humanity.

I fully agree, I don’t use electron apps anymore. Pure bloat and wastefulness.

Glad to hear that firejail solved your issue. I don’t use fire jail anymore either. I guess my security concerns have lessened somewhat from what they used to be when I left the Windows world.

3 Likes

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