Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caprine deletes all bitmap fonts from fontconfig cache on Linux #2163

Open
miranda opened this issue Apr 9, 2024 · 6 comments
Open

Caprine deletes all bitmap fonts from fontconfig cache on Linux #2163

miranda opened this issue Apr 9, 2024 · 6 comments

Comments

@miranda
Copy link

miranda commented Apr 9, 2024

Garuda Linux
6.8.4-zen1-1-zen
KDE Plasma 6 - X11

Some versions of Electron apparently delete all your bitmap fonts from your font cache and you must use fc-cache --force to get them back. This is insanely annoying if you use bitmap fonts at all.

If you install any .bdf or .pcf fonts, and then launch the official Caprine AppImage (2.59.3) these fonts will immediately be removed from your system.

I also have Upscayl installed which is using Electron 29, and so far it doesn't seem to delete my fonts. So perhaps this is only caused by the old version of Electron Caprine is using? Or maybe Caprine is doing something specific with fonts in Electron that is triggering this infuriating behaviour?

@miranda
Copy link
Author

miranda commented Apr 12, 2024

I discovered this also happens from running Discord, another Electron app. I replaced my Discord package with one that uses the Electron 29 package on my system, and it also no longer deletes my fonts.

So, more evidence that this bug will hopefully go away if Caprine is changed to use Electron 29.

@mquevill
Copy link
Collaborator

The newest release (v2.60.1) uses Electron 29. Can you test with the AppImage install from v2.60.1?

@miranda
Copy link
Author

miranda commented Apr 12, 2024

The newest release (v2.60.1) uses Electron 29. Can you test with the AppImage install from v2.60.1?

Oh god... the AppImage still deletes my fonts upon launch!!!

Caprine must be doing something different than other apps using Electron 29 then?
Is there anything I can do to help determine why it's doing this?

@miranda
Copy link
Author

miranda commented Apr 23, 2024

Someone really needs to get to the bottom of this. It seems like Electron still does this, but only for some apps, like Caprine obviously. I've found more that do it.

The only way I could stop this without banning all Electron apps from my system was to set up firejail for the offending apps and block them from altering my home directory.

@miranda
Copy link
Author

miranda commented Apr 26, 2024

Ok, so I spent a lot of time trying to figure this out. I think it may actually be fixed, but not in Electron 29. I am not sure why some Electron apps using 29 did not seem to trigger the bug. But I set up VS Code and built Caprine using the the 29 that was in package.json, and the resulting app deleted my fonts. However, by simply modifying package.json it to use Electron 30.0.1, the font deletion stopped.

I'm not 100% sure this bug isn't still in Electron and able to be triggered a different way... but so far I've not seen any evidence of that. Since there's not really been any acknowledgement of the bug, there's no way to know for sure. But so far, so good.

Anyway, with all that said... it seems the problem will be gone once the Linux builds are updated. I'd attach mine but they are too big to be allowed here.

@mquevill
Copy link
Collaborator

mquevill commented May 2, 2024

There's nothing specific that Caprine does to the font cache storage as far as I'm aware. I tried to track down some information regarding this issue, but couldn't find anything conclusive. One thing that I gathered is that .bcf and .pcf fonts aren't supported as well as .otb format fonts on Linux systems.

If this is confirmed to be fixed with Electron 30, then eventual upgrades would address this issue. I'm not fully convinced that v30 will completely solve this issue. For now, I'll leave it as waiting on the issue you raised in the Electron repo: electron/electron#41971

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants