Tip: Managing fonts

Tons of fonts get installed on linux systems and that makes the font scroll list in editors or word processors painfully long. I’ve always used the font manager in kde to hide fonts or I manually deleted the fonts that I did not want. But somehow those unwanted fonts always crept back in when my back was turned. Then I found a solution using ~/.config/fontconfig/fonts.conf. Thanks to Ferdinand on the Manjaro forum.
https://forum.manjaro.org/t/font-management/117716
Also see:
Whitelist and blacklist fonts.
https://wiki.archlinux.org/index.php/Font_configuration#Whitelisting_and_blacklisting_fonts

This solution is easy to implement, can be easily modified, and can be used over and over. A benefit is the fonts are not deleted, they just don’t show up in your user session.

Edit your ~/.config/fontconfig/fonts.conf file and:

  1. Put the fonts you do not want to see in the rejectfont section
  2. Put any fonts from the above rejection groups that you might want to keep in the acceptfont section
  3. Fonts not added to the rejectfont section will not be affected.

My ~/.config/fontconfig/fonts.conf file:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <!-- Local settings -->
 <selectfont>
    <rejectfont>
       <glob>/usr/share/fonts/noto/Noto*</glob>
       <glob>/usr/share/fonts/gsfonts/*</glob>
       <glob>/usr/share/fonts/TTF/DejaVuMathTeX*</glob>
       <glob>/usr/share/fonts/TTF/odo*</glob>
       <glob>/usr/share/fonts/mathjax2/*</glob>
       <glob>/usr/share/fonts/croscore/*</glob>
    </rejectfont>
    <acceptfont>
       <glob>/usr/share/fonts/noto/NotoSans-*</glob>
       <glob>/usr/share/fonts/noto/NotoSerif-*</glob>
       <glob>/usr/share/fonts/gsfonts/NimbusMono*</glob>
       <glob>/usr/share/fonts/gsfonts/NimbusRoman*</glob>
       <glob>/usr/share/fonts/gsfonts/NimbusSans*</glob>
       <glob>/usr/share/fonts/gsfonts/URW*</glob>
    </acceptfont>
 </selectfont>
</fontconfig>

Note: Your fonts.conf file may contain other useful stuff, that’s ok, leave it there.

11 Likes

Good one. A wiki entry perhaps?

3 Likes

That’s a nice tip!
Surely worth a wiki article.

3 Likes

That was awesome! Just hid three files and now my font menus are manageable. Thanks!

2 Likes

Sry 4 necrobumping; but my fonts.conf said:

<!-- created by lxqt-config-appearance (DO NOT EDIT!) -->

And I was not sure if I had a lxqt app at some point managing my font files; as I am running wayland, things for managing my graphics stuff changed frequently over the past.

However: /etc/fonts/fonts.conf said as well:

!--
        DO NOT EDIT THIS FILE.
        IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
        LOCAL CHANGES BELONG IN 'local.conf'.

So my setup required changes in: /etc/fonts/conf.d/51-local.conf

As soon as I put the noto exclusions in there, it showed up perfectly (no long list in libreoffice anymore).
So I expect it to be persistent through package upgrades, this should do it, hence it may be helpful for others looking at similar setups going forward.

EDIT: if anyone bothered to read this, this is not an issue. But potentially a more up-to-date SOLUTION. But thanks for the heads up, for issues I’d have made a new topic regardless.

@actually_peanuts, The last response on this thread is nearly 5 years old. The info contained within this thread has got to be out of date. Try posting a new thread about your issue. Good luck!

3 Likes

Listen to @UncleSpellbinder !

closed

2 Likes