Improve Fonts Rendering Quality on Arch Linux


Arch Linux is a lightweight, simple and minimalist distro, at early pacstrap only install the base packages which is very minimalist to build customized Linux from scratch even most required fonts not installed by default then it will fallback to bitmaps font if the fonts is missing.

The fonts rendering can be improved by installing the missing fonts, disable the bitmaps fonts, and infinality patchset* (deprecated).

Install the missing font

Missing font can causing X displaying fallback font in example bitmaps or default fontconfig font, You can try  to install the missing font from official Arch Linux Repository and Arch User Repository (AUR):
sudo pacman -S ttf-bitstream-vera ttf-inconsolata ttf-ubuntu-font-family ttf-dejavu ttf-freefont ttf-linux-libertine ttf-liberation --noconfirm
yaourt -S otf-ipafont ttf-amiri ttf-ancient-fonts ttf-ms-fonts ttf-monaco ttf-noto ttf-vista-fonts --noconfirm
Warning: Installing too many unnecessary font causing clutter to storage and decrease performance of the font cache. Then reboot the computer or continue to the next steps:
reboot

Disable bitmaps fonts

Bitmaps fonts used as fallback font if the required font is missing, but render the text to pixelated, run following command to disable the bitmaps rendering fonts:
sudo ln -s /etc/fonts/conf.avail/70-no-bitmaps.conf /etc/fonts/conf.d
Instead fallback to bitmaps fonts it will fallback to default fontconfig configuration font Then reboot the computer or continue to the next steps:
reboot

Install Infinality-Bundle (deprecated)

Add Infinality to pacman package manager configuration file, edit the file using text editor such as nano:
sudo nano /etc/pacman.conf
In order to use the repository, add the following to your pacman.conf:
[infinality-bundle]
Server = http://bohoomil.com/repo/$arch
If you want to access multilib libraries in x86_64 architecture as well (for 64 bit), add also this:
[infinality-bundle-multilib]
Server = http://bohoomil.com/repo/multilib/$arch
Then uncomment the multilib on pacman configuration to download and install 32 bit package on 64 bit systems (for 64 bit)
[multilib] 
Include = /etc/pacman.d/mirrorlist
Additionaly, if you want to use a comprehensive collection of free fonts from the infinality-bundle-fonts repository, append
[infinality-bundle-fonts]
Server = http://bohoomil.com/repo/fonts
Then import and sign bohoomil (dev key) to pacman local key database (run as root)
sudo pacman-key -r 962DDE58
sudo pacman-key --lsign-key 962DDE58
Install the Infinality Bundle for Arch Linux (32 Bit)
sudo pacman -Syy infinality-bundle
Install the Infinality Bundle for Arch Linux (64 Bit)
sudo pacman -Syy infinality-bundle-multilib
If there confirmation dialog to resolve the package conflict, type "y" to continue. Then reboot the computer
reboot
By default, fontconfig will use presets for the free font collection from [infinality-bundle-fonts] repository. If you are going to use either a custom font collection or core Microsoft families, set the appropriate presets using fc-presets command.

Restore to default settings

If you're encountered an issue with the fonts rendering after applied above instructions you can try to restore or reset back to default settings

For the missing fonts

It is not recommend to uninstall the missing fonts unless it unnecesary or even useless, run following command to uninstall the font:
pacman -R ttf-thefont

For the bitmaps fonts

If you're encountered an issue e.g artifacts or flickering font after disable the bitmaps fonts, you can restore to the default settings:
sudo rm /etc/fonts/conf.d/70-no-bitmaps.conf

For the Infinality-Bundle

If you're encountered an issue e.g subpixel rendering or weird font after installing the Infinality-Bundle, you can troubleshoot the issue or uninstall the Infinality-Bundle to restore to the default fontconfig: For 32 Bit System sudo pacman -Rdd infinality-bundle && sudo pacman -S cairo fontconfig freetype2 For 64 Bit System sudo pacman -Rdd infinality-bundle infinality-bundle-multilib && sudo pacman -S cairo fontconfig freetype2

Troubleshooting

GNU Privacy Guard (GNUPG) Error: Remote key not fetched correctly from keyserver

This error usually caused by Dirmngr error when opening dirmngr_ldapservers.conf not properly, to solve this issue run following command from terminal:
mkdir /root/.gnupg
mkdir /root/.gnupg/dirmngr-cache.d
touch /root/.gnupg/dirmngr-cache.d/DIR.txt
touch /root/.gnupg/dirmngr_ldapservers.conf
Alternative:
sudo su
dirmngr then ^C
touch dirmngr_ldapservers.conf /root/.gnupg/

See also

  1. Fonts - Archwiki
  2. Infinality - ArchWiki
  3. Infinality-Bundle: good looking fonts made (even) easier - Arch Linux Forums
  4. [Solved] pacman-key keyserver refresh failed: No dirmngr - Arch Linux Forums
  5. Image by dxiri / CC BY 2.0

Comments