In this article I would like to describe a very effective, in my opinion, way to improve the appearance of fonts in Gentoo Linux. Perhaps the article will not seem so informative to experts, but I hope that it will help to make this wonderful distribution the main system for more users.
Despite the fact that I have been using Gentoo for only a few months, this distribution has already managed to please me more than others because of its flexible and extensive features. But, as is often the case with people switching from Windows to Linux, I didn’t really like the look of standard fonts (I have Gnome 2 graphical environment), especially in program code editors. And when I tried to transfer the same Consolas from Windows, I regretfully found that it looks much worse in Gentoo than in Windows. Then I began to look for an opportunity to improve font rendering.
I did not find a specific answer in the Gentoo documentation and on the Russian-language forum, but, fortunately, I found the project
infinality in the search. As part of this project, patches have been developed that help to improve font smoothing, as well as to customize the rendering mechanism to suit your taste. I think this is the best way at the moment.
')
In addition, there is overlay, which already contains these patches. It is called
lcd-filtering .
So, you need to do the following steps:
- We delete just in case the current configuration of fonts:
rm -rf /etc/fonts/conf.d rm ~/.fonts.conf
- Connect overlay:
layman --add lcd-filtering
- In /etc/make.conf we add the USE flag lcdfilter and exclude cleartype (-cleartype)
- Unmask packages freetype, fontconfig, libXft, cairo
- Install packages:
emerge -av freetype fontconfig libXft cairo
- After installing the packages, the system will give a notification about the need to update several configuration files. Run etc-update and replace the old configuration files with new ones.
- Now download the file by
reference and save the fontconfig rules in it in ~ / .fonts.conf - in the future, you can change the settings in it without touching the global configuration files.
- In case applications will be installed that ignore settings from ~ / .fonts.conf, create a file ~ / .Xresources and write to it:
Xft.autohint: 0 Xft.lcdfilter: lcddefault Xft.hintstyle: hintfull Xft.hinting: 1 Xft.antialias: 1 Xft.dpi: 96 Xft.rgba: rgb
- Go to
“Appearance Settings” -> “Font” tab and switch font rendering from
“Subpixel anti-aliasing” to
“Best Style ” (it seemed to me that it looks better in me, but here it’s a matter of taste).
Reboot. Now the fonts look much better, and the .ttf fonts (for example, Consolas on the screenshot below) look as good as on Windows with cleartype enabled.
Before applying patches (subpixel smoothing is included):

After applying the patches:
