Many unwanted fonts get installed on Linux systems and that can make the font scroll list in editors and word processors painfully long. There are many methods and apps to trim font lists, but somehow those unwanted fonts always creep back in when your back is turned or you do a reinstall.
An easy solution to tame those unwanted fonts is to use a ~/.config/fontconfig/fonts.conf file to whitelist and blacklist fonts. It’s easy to implement, can be easily modified, and can be saved and used over and over. Another benefit is the fonts are not deleted, they just don’t show up in your user session. All fonts listed in the <rejectfont> section are blacklisted, while fonts listed in the <acceptfont> section are whitelisted as subsets of the rejected fonts you want to allow. Think of the rejects as a larger parent set and the accepts as a smaller, select sub-set of that parent.
Edit or create a ~/.config/fontconfig/fonts.conf file and:
- Put the fonts you do not want to see in the rejectfont section.
- Put any fonts from the above <rejectfont> section that you might want to keep in the <acceptfont> section.
- Fonts not added to the <rejectfont> section will not be affected.
A sample ~/.config/fontconfig/fonts.conf file might look like this:
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<!-- Local settings -->
file all the Noto fonts were initially rejected and then later NotoSans and NotoSerif were added back by whitelisting them.
- Your fonts.conf file may contain other useful stuff, that’s ok, leave it there.
- Be sure and save a backup of this file for future use. If your working fonts.conf file gets deleted or disappears on a reinstall of your OS you can always recover it.
In this fonts.conf file all the Noto fonts were initially rejected and then later NotoSans and NotoSerif were added back by whitelisting them.
For reference see:
- Font Management – https://forum.manjaro.org/t/font-management/117716
- Whitelist and blacklist fonts. – https://wiki.archlinux.org/index.php/Font_configuration#Whitelisting_and_blacklisting_fonts