Improve Font Rendering Quality on Arch Linux


Arch Linux is a lightweight, simple and minimalist Linux distro, at early installation, pacstrap only install the base packages which is very minimalist even most required fonts not installed by default, causing the fonts will fallback to bitmaps font or fontconfig font because the fonts are 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 cause Xorg display fallback font, in example bitmaps or default fontconfig font, You 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-ancient-fonts ttf-ms-fonts ttf-monaco ttf-noto ttf-vista-fonts --noconfirm
Warning: Installing too many unnecessary font can cause clutter the storage and decrease performance of the font cache. Then reboot the computer or continue to the next steps:
reboot

Disable bitmaps fonts

If the required font is missing, Xorg will display fallback bitmaps as the fallback font, but font may appear to be 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

Post a Comment