Get rid of unused fonts

Forums: 
Forum tags: 

By default, many Linux distros come with tons of junk fonts for every locale imaginable - Devangari, Pashto, Arabic, Thai, Urdu etc.

With all due respect for those folks, probably even they're going to need ONE of those regions on their machine, tops. As for the rest of the world, we'll be fine with Latin.

Do you know an easy, reliable way to map font names to locales? I looked in Ubuntu in /usr/share/fonts, and it was not as immediately obvious as it is with localizations (translation) files which have the locale name embedded like es for Spanish and fr for French.

---
Andrew, lead developer

dandv's picture

Not sure about a reliable way, but I've asked the question on AskUbuntu: http://askubuntu.com/questions/820746/remove-unused-fonts/820760

"unused" fonts is hard to assess. Even if your language does not need them, you are exposed to international texts on the web (e.g. visit Wikipedia).
As well there's only a default minimal set of font for all languages but none of them are required (except the fonts for the boot-time console) as they can all be replaced with another (e.g. switch from Arial to Segoe UI or to Noto).
Some applications also don't use the system defaults but need their own fonts (typically games).
Fonts anyway do not take lot of space on the system, and it's quite easy to remove those you don't want from the Settings/ControlPanel.
And we have now tons of multilingual documents, it's not fun if the system does not support at least a minimum set of fonts for wellknown worldwide scripts (Latin, Greek, Cyrillic, Arabic, Hebrew, Devanagari, Thai, Korean Hangul, Katakana, Hiragana, Simplified Chinese) with a good coverage.
The whole set of Noto fonts is a good minimal set and it does not take a lot of disk space.
It's just better to cleanup unnecessary localization files and translations (help files, textual icon sets). But any system should have at least the minimum en-US language as a fallback (remove all other English variants) and the user locale, so that software will work reliably.

As well we can cleanup unnecessary keyboard layouts, but I hate that Linux sometimes only install with ONLY the US QWERTY layout and the other local keyboard is not even handled correctly at installation time and not available in mainterance boots: typing local user password to login is sometimes even impossible or does not work reliably (e.g. passwords with digits cannot be composed on the numeric keypad due to incorrect emulation, or CapsLock/ShoiftLock not working as expected, making it difficult to logon (e.g. on an AZERTY keyboard, digits on the 1st row require using Shift, French user stypically want to use the numeric keypad which must be in numeric mode, or have to use the shift key and guess what is the current capslock state, not always displayed correctly and not even matching the status of the CapsLock LED on the keyboard).
Being able to switch keyboard layout is necessary to avoid locking all access to the OS. So I suggest not cleaning up any keyboard layout that has been installed (layouts use extremely low space on disk, they are not spacehogs).

Bleachbit is made to be used for regular and frequent/fast maintenance without careful inspection. If you need specific "microcleanup", use the other existing system panels and package managers.

And cleaning up what seems "unused fonts" could then block you from using your existing documents that you have worked with: your word processor, or Excel sheet may not have proper layout, web forms would no longer be properly aligned, texts may be truncated if missing fonts are replaced by fallback fonts with different metrics. And it's not always easy to determine again what was the necessary fonts.

However if your system handles vector fonts natively, legacy bitmapo fonts (e.g. for X11) may be cleaned up, except the few ones needed for the boot time console. on Windows the minimal boot time fonts are part of the boot environement and protected, you cannot drop them, as well a few fonts are reserved for the UI and remain protected. If you erase all other fonts, various software may refuse to run (and these fonts installed for these softwares are not easily reinstallable without running again the application installer, which could destroy/reset all your preferences.

Much space on the system is not taken by fonts, but actually by localization files, LUI/MUI packs on Windows, help files, and by lot of archiving.

After each major update of Windows, I like using "Dism++" because it cleans up more than 30 Gigabytes (more than 200k files and directories, plus tons of old/default drivers that have been replaced, lot of system image snapshots!) instantly and easily (and in fact it works even better and faster than the Windows version of Bleachbit). And it does that extremely safely (it also helps solving problems that block you from updating your system and considerably accelerates the update process). It does not cleanup the registry (CCleaner can do that) but the registry cleanup does not save space, it just removes nonworking links that slow down Windows trying to access them and helps protecting the privacy too and avoids problems when we have to reinstall some applications.