A slightly better font rendering config

Post Reply
User avatar
akts
Posts: 7
Joined: 8. Oct 2021, 04:42
Location: /dev/null
Contact:

A slightly better font rendering config

Post by akts » 16. Oct 2021, 16:27

How people setup their font preference is a very personal thing. It might be tailored to the monitor that they use or maybe they'd like their fonts to be extra crispy and sharp.

The following is font configuration tweaks that I apply on the machines that I run.

1. Xresources

Open the file .Xresources in our $HOME folder and add this in.

Code: Select all

Xft.autohint: 1
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.dpi: 96
Xft.rgba: rgb
Xft.lcdfilter: lcddefault

2. fontconfig

Make sure the folder $HOME/.config/fontconfig exists. Now we create a file called fonts.conf in it.
The complete path to the file would be $HOME/.config/fontconfig/fonts.conf
Add the following to it.

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <edit mode="assign" name="hinting" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="autohint" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle" >
            <const>hintslight</const>
        </edit>
        <edit mode="assign" name="rgba" >
            <const>rgb</const>
        </edit>
        <edit mode="assign" name="antialias" >
            <bool>true</bool>
        </edit>
        <edit mode="assign" name="lcdfilter">
            <const>lcddefault</const>
        </edit>
    </match>
</fontconfig>
We can also set our user's default Sans, Serif and Monospace fonts in that file also. The fontconfig from bunsenlabs linux i.e the place I got this tweak from ;) is there at the Resources section of this post. It shows us how to do this.

Now all that's left is to logout and log back in.

The fruits of our labor looks like this
Image

Resources If you guys would like to share your font config or tweaks, please do so.

Cheers!
Image

User avatar
ivanovnegro
Posts: 12
Joined: 5. Jul 2021, 22:07

Re: A slightly better font rendering config

Post by ivanovnegro » 16. Oct 2021, 23:26

Hi akts,

firstly I think we know each other, so greetings to you. I can remember your great Slackware how-to!.

And second, great post. That fixes the blurry fonts on Firefox-ESR. I did not even notice it because I do not really use Firefox that much nowadays and in fact that font config is the one I always used on Debian before Debian itself fixed the font rendering.

User avatar
akts
Posts: 7
Joined: 8. Oct 2021, 04:42
Location: /dev/null
Contact:

Re: A slightly better font rendering config

Post by akts » 17. Oct 2021, 03:26

Hi ivanovnegro,

No way! You're Ivan from the bbq :o
Thank you for your kind words. Greetings to you too. How have you been?

I seem to remember your Infinality font guide and a few others on the bbq forums as well. As a matter of fact, you guys at the bbq forums writing insane tutorials and scripts, was the reason why I also gave it a try :D

If I may ask, what browser do you use?
Image

User avatar
ivanovnegro
Posts: 12
Joined: 5. Jul 2021, 22:07

Re: A slightly better font rendering config

Post by ivanovnegro » 17. Oct 2021, 14:05

Yes, it is me. I am doing fine. Thank you.
akts wrote:
17. Oct 2021, 03:26
If I may ask, what browser do you use?
Of course I have Firefox-ESR installed and use it as my second browser but lately I am using Pale Moon on older hardware. It just runs better with 50+ tabs open and it reminds me of the good old days of Firefox. I really cannot stand the floating tabs that Firefox now comes with. The design is just horrible and the bulky address bar before it but I do not want to turn this thread into a rant. Maybe I am getting just older.

User avatar
akts
Posts: 7
Joined: 8. Oct 2021, 04:42
Location: /dev/null
Contact:

Re: A slightly better font rendering config

Post by akts » 30. Oct 2021, 07:08

I never tried Palemoon before. Thank you for recommending it.

Got it installed from http://repo.khronosschoty.org/Slackware/Pale-Moon and its definitely bringing back memories :D

The FF redesign took some time to sink in with me too. If you want to bring back the old tab look, you can tweak it in about:config

Code: Select all

about:config -> browser.proton.enabled -> false
Got that little tweak from a tweet by openbsd's @jcs

Cheers!
Image

User avatar
ivanovnegro
Posts: 12
Joined: 5. Jul 2021, 22:07

Re: A slightly better font rendering config

Post by ivanovnegro » 30. Oct 2021, 20:01

akts wrote:
30. Oct 2021, 07:08
The FF redesign took some time to sink in with me too. If you want to bring back the old tab look, you can tweak it in about:config

Code: Select all

about:config -> browser.proton.enabled -> false
I think that about:config entry no longer works with the latest version of Firefox or Firefox-ESR respectively. I just disabled it with some CSS hacking.

Post Reply