There's no need to uninstall any package, since fontconfig
provides a way to blacklist some fonts or paths, and exclude them as if they didn't exist in the system.
You just need to add a few lines like these in system or user configuration:
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/truetype/fonts-beng-extra/*</glob>
</rejectfont>
</selectfont>
Where to put configuration
- To disable those fonts system wide you put those instructions in
/etc/fonts/local.conf
- To disable those fonts for just one user you put them in
~/.config/fontconfig/fonts.conf
To set the default behaviour for each new user, put this configuration in /etc/skel/.config/fontconfig/fonts.conf
.
This way unwanted fonts are disabled by default, but users can still enable them back editing their own fontconfig
configuration file (this last approach seems more versatile for my use case).
Obviously if you put this configuration in /etc/skel/
it won't affect existing users. They need to manually copy it in their own home directories to make it work.
Example configuration
Here's my full fonts.conf
file, that disable all non-latin fonts I don't need. It lives in ~/.config/fontconfig/fonts.conf
.
This not only make fonts list shorter, but also make some applications such as LibreOffice a little faster, since they need to cope with less fonts to preview, and user can still enable some fonts for him/herself if needed, without affecting other users and without administrator privileges.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- disable non-latin fonts -->
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/opentype/malayalam/*</glob>
<glob>/usr/share/fonts/opentype/noto/*CJK*</glob>
<glob>/usr/share/fonts/truetype/abyssinica/*</glob>
<glob>/usr/share/fonts/truetype/fonts-beng-extra/*</glob>
<glob>/usr/share/fonts/truetype/fonts-deva-extra/*</glob>
<glob>/usr/share/fonts/truetype/fonts-gujr-extra/*</glob>
<glob>/usr/share/fonts/truetype/fonts-guru-extra/*</glob>
<glob>/usr/share/fonts/truetype/fonts-kalapi/*</glob>
<glob>/usr/share/fonts/truetype/fonts-orya-extra/*</glob>
<glob>/usr/share/fonts/truetype/fonts-telu-extra/*</glob>
<glob>/usr/share/fonts/truetype/Gargi/*</glob>
<glob>/usr/share/fonts/truetype/Gubbi/*</glob>
<glob>/usr/share/fonts/truetype/kacst/*</glob>
<glob>/usr/share/fonts/truetype/kacst-one/*</glob>
<glob>/usr/share/fonts/truetype/lao/*</glob>
<glob>/usr/share/fonts/truetype/lohit*</glob>
<glob>/usr/share/fonts/truetype/malayalam/*</glob>
<glob>/usr/share/fonts/truetype/Nakula/*</glob>
<glob>/usr/share/fonts/truetype/Navilu/*</glob>
<glob>/usr/share/fonts/truetype/padauk/*</glob>
<glob>/usr/share/fonts/truetype/pagul/*</glob>
<glob>/usr/share/fonts/truetype/Sahadeva/*</glob>
<glob>/usr/share/fonts/truetype/samyak/*</glob>
<glob>/usr/share/fonts/truetype/samyak-fonts/*</glob>
<glob>/usr/share/fonts/truetype/Sarai/*</glob>
<glob>/usr/share/fonts/truetype/sinhala/*</glob>
<glob>/usr/share/fonts/truetype/tibetan-machine/*</glob>
<glob>/usr/share/fonts/truetype/tlwg/*</glob>
<glob>/usr/share/fonts/truetype/ttf-khmeros-core/*</glob>
</rejectfont>
</selectfont>
</fontconfig>
References