Sharing Generic steps to achieve decent font rendering

Generic steps to achieve decent font rendering.

Before following steps mentioned below suggest you to read ArchWiki at following URL - https://wiki.archlinux.org/index.php/Font_configuration

Usually Step 1 - 5 shud be enough. I executed steps 1 - 5 in Manjaro KDE Plasma 5 setup.

if you are not satisfied with steps 1-5 then try remaining 3 ways.

Suggest to Try only one of the 4 ways.

Step 12 - 13 is common for either of the 4-different ways listed below.

Note: Enabling LCD filter is optional. If setting correct RBGA, DPI and hinting does not suffice then enable LCD filter and choose filter subject to what works best for you.

System Settings. Current user

Step 1. Launch system settings and navigate to section responsible for font setting and rendering. Select a True Type Font of your choice. I use Noto Sans as standard font and Ubuntu Mono for terminal. These are hinted fonts available in Manjaro repository among many. For Ubuntu fonts install ttf-ubuntu-font-family package from community repository

Step 2. Enable Antialias

Step 3. Enable Sub Pixel rending and set to correct sub pixel order identified for ur monitor. RGB is the most common order. Others wud be BGR, VBGR, VRGB.

Link to Test sub pixel order - http://www.lagom.nl/lcd-test/subpixel.php

Step 4. Enable Hinting and set hinting style to Slight. More hinting makes font crisp and sharp.
Full hinting could make them too thin and light if fonts don’t have sufficient hinting info. You cud also try hint style medium.

Step 5. Set DPI based on your Display. For me its 96.

Run below command in terminal to get DPI.
xrdb -query | grep dpi

DOING THIS MANUAL WAY. AFFECTS CURRENT USER ONLY. Creating .Xresources file

Step 6. Create “.Xresources” file in ur home directory with following content

-----Start Here-----[Don’t copy this Line]

! Modify DPI with reference to ur display
Xft.dpi: 96

! Modify Sub Pixel order with reference to ur display. Possible values RGB, BGR, VBGR, VRGB
Xft.rgba: rgb

Xft.autohint: false
Xft.antialias: true
Xft.hinting: true

! Possible values hintslight. hintmedium, hintfull, hintnone
Xft.hintstyle: hintslight

! Possible values lcddefault, lcdlegacy, lcdlight . Enable only if required.
! Xft.lcdfilter: lcddefault

-----End Here----- [Don’t copy this Line]

DOING THIS MANUAL WAY. AFFECTS CURRENT USER ONLY. Creating fonts.conf file

Step 7. Now navigate to $HOME/.config/fontconfig/
and verify fonts.conf exists.

If file does not exist use file from following URL.(File shared from my personal google drive account)

https://drive.google.com/open?id=0B31YqShzwlDIeV9tbXlRUm93OGM

If file exists Backup yours and use downloaded file.

For hint style as hintmedium set hintstyle to hintmedium in fonts.conf

For hint style as hintfull set hintstyle to hintfull in fonts.conf

For hint style as hintnone set hintstyle to hintnone in fonts.conf

LCDFILTER section is commented in downloaded fonts.conf. If required uncomment and

For default filter set lcdfilter to lcddefault in fonts.conf

For legacy filter set lcdfilter to lcdlegacy in fonts.conf

For light filter set lcdfilter to lcdlight in fonts.conf

If sub pixel order is not RGB then set value for rgba in fonts.conf as explained below.

For BGR
Replace rgb with bgr

For VBGR
Replace rgb with vbgr

For VRGB
Replace rgb with vrgb

MODIFYING SETTING SYSTEMWIDE Steps 8 -11

Step 8. Launch Terminal and navigate to /etc/fonts/conf.d

Step 9. Run only one command for Sub Pixel order relevant to ur display

Execute sudo ln -s …/conf.avail/10-sub-pixel-rgb.conf (To enable RGB sub pixel rendering)
Execute sudo ln -s …/conf.avail/10-sub-pixel-bgr.conf (To enable BGR sub pixel rendering)
Execute sudo ln -s …/conf.avail/10-sub-pixel-vbgr.conf (To enable VBGR sub pixel rendering)
Execute sudo ln -s …/conf.avail/10-sub-pixel-vrgb.conf (To enable VRGB sub pixel rendering)

Step 10. Hint style systemwide defaults to hintslight . To change it Run only one of below commands

Execute sudo ln -s …/conf.avail/10-hinting-medium.conf (To enable medium hinting)
Execute sudo ln -s …/conf.avail/10-hinting-full.conf (To enable full hinting)
Execute sudo ln -s …/conf.avail/10-hinting-none.conf (If hinting not required)

Step 11. Run only one command. Enable only if step 8 - 10 does not provide desired results.

Execute sudo ln -s …/conf.avail/11-lcdfilter-default.conf (To enable Default LCD Filter)
Execute sudo ln -s …/conf.avail/11-lcdfilter-legacy.conf (To enable Legacy LCD Filter)
Execute sudo ln -s …/conf.avail/11-lcdfilter-light.conf (To enable Light LCD Filter)

Freetype Interpreter setting

Step 12. Quoted by @philm in [Obsolete] [Font Rendering] How to install Infinality fonts in Manjaro Linux - v4.0

From freetype2 2.7, subpixel hinting uses upstream’s configuration method, which has a
different syntax. Subpixel hinting mode configured in the file /etc/profile.d/freetype2.sh which includes a brief documentation. Possible values are truetype:interpreter-version=35 (classic mode/2.6 default), truetype:interpreter-version=38 (“Infinality” mode), truetype:interpreter-version=40 (minimal mode/2.7 default).

I have Infinality mode set
export FREETYPE_PROPERTIES=“truetype:interpreter-version=38”

Step 13. Now restart, Just logout and login might not show desired results.

8 Likes

If you were using Bohomil Infinality packages then follow below URL to have clean switch.

Forum kindly sponsored by Bytemark