Configuring XFT trought fonts.conf

This article describes how to get antialiased fonts on X except for a given range, and, for this excluded range, force to use the BCI (Byte Code Interpreter) that produces better results for non antialiased fonts.

The guideline has been tested in Gentoo, but may works in other distros.

Summary

You'll do these steps...

  • Edit a system file in /etc/fonts.
  • Download and save two fonts.conf files in your home.
  • Download a third file .Xdefaults in your home again.
  • Depending on you desktop, configure to load a .Xdefaults I provide here as an attachment every time you opens a X session.
  • Restart X

First of all, we know that the file at ~/.fonts.conf is where we must put all our custom configs. The problem is KDE (and maybe other Desktop Environments too) will replace this files with his "fucking shit". To solve this problem I edited a system file: /etc/fonts/conf.d/50-user.conf

This file must be something like this:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Load per-user customization file -->
<include ignore_missing="yes">~/.fonts.conf</include>
<include ignore_missing="yes">~/.fonts-ex.conf</include>
</fontconfig>

As you can see, I added an extra custom file called .fonts-ex.conf. Whith this technique we will prevent that you DE replaces you custom settings.

Now, all you must to do is download both files attached here and save in you home (replacing if exists .fonts.conf).

Finally, download Xdefault and save it to: ~/.Xdefaults.

You must load this Xdefault settings when starts your X session, to do it you have several ways, I'll describe the KDE-way:
Downlad and save xrdb.desktop to ~/.kde/Autostart/

Restart you X and enjoy.

OTHER REQUIREMENTS
* You must have FreeType builded with USE="-bindist" to get BCI enabled.

SAMPLE

AttachmentSize
fonts.conf621 bytes
fonts-ex.conf2.04 KB
sample.png25.34 KB
Xdefaults118 bytes