Table of Contents
http://wiki.archlinux.org/index.php/XOrg_Font_Configuration
X.org Font Configuration and beautification
X.org Font Path and /etc/fonts/
Goodies
As you can see, freetype provides everything provided by these other modules already. In addition, xtt will conflict with freetype.
The font path described in the xorg.conf file is used for non-Xft fonts. It is worthwhile to specify a majority of fonts here. Applications which do not support Xft will fall back to the X Server's font path. Personally, I keep a minimum of fonts here - for use with xterm and it's ilk.
The conf files in /etc/fonts (fonts.conf and local.conf) are used for fontconfig (Xft fonts). fonts.conf should never be changed, and all changes should be done in local.conf (for system wide changes) or ~/.fonts.conf (for user based changes). Files in /etc/fonts/conf.d are sourced when they start with a number and end with .conf.
The directories listed in fonts.conf are scanned by fc-cache for use with fontconfig (/usr/share/fonts and ~/.fonts). All fonts should be placed in these directories. If installing new fonts, running fc-cache -fv will detect the changes.
When new fonts are added, they are just files on your system. A handful of utilities need to be run in order to tell the system that new fonts have been added.
/usr/bin/fc-cache
This will update the fontconfig cache, assuming the new fonts can be searched by fontconfig (see the above section about /etc/fonts)
/usr/bin/mkfontscale /usr/bin/mkfontdir ln -s /usr/X11R6/lib/X11/fonts/encodings/encodings.dir encodings.dir
These utilities need to be run from inside the directory of the new fonts. mkfontscale creates a fonts.scale file and mkfontdir creates a fonts.dir file. These files are used by the X Server, and only need to be done if the fonts are to be served through the FontPath of X.org. The encodings soft link allows the X Server to use these new fonts under all supported encodings. After all this, you should have 3 new files in the font dir : fonts.scale, fonts.dir, and encodings.dir.
These utilities will list, from the command line, all fonts available to each font subsystem. fc-list will list all fontconfig fonts, while xlsfont will list all X fonts. This is useful in combination with grep, i.e. "xlsfonts || grep -i bitstream" to see all bitstream fonts available.
Save your fonts in a directory and add it to /etc/fonts/local.conf
<dir>/path/to/dir</dir>
Yeah, this happens. Modern GTK apps enable Xft by default, however, before 2.2 this was not the case. Maybe these apps should be updated to the newer GTK. If that is not an option, then adding the line export GDK_USE_XFT=1 to a global settings file (/etc/profile, /etc/profile.d/gnome.sh, ~/.xinitrc, etc) will enable Xft for older apps
For similar problem as above with older Qt based apps, similar solution, add export QT_XFT=true somewhere.
Autohinter can give you nice fonts but often makes fonts too wide. This is especially annoying with bold fonts. Fortunatelly you can turn off autohinter for bold fonts while leaving it on for the rest.
First turn on autohinter (see above) and add the following to /etc/fonts/local.conf or ~/.fonts.conf
<match target="font"> <test name="weight" compare="more"> <const>medium</const> </test> <edit name="autohint" mode="assign"> <bool>false</bool> </edit> </match>
A sample of this is in the /etc/fonts/local.conf file. It is commented, just like the subpixel rendering section. Changes, if anything, should be made to the compare="less_eq" portion, and the <int>12</int> portion - these are the comparison operation and point size to compare, respectively.
<match target="pattern"> <test qual="any" name="size" compare="less_eq"> <int>12</int> </test> <edit name="antialias" mode="assign"><bool>false</bool></edit> </match>
<match target="font" > <test compare"more" name"size" qual="any" > <double>12</double> </test> <edit mode"assign" name"antialias" > <bool>true</bool> </edit> </match>
<match target="font" > <test compare"more" name"pixelsize" qual="any" > <double>17</double> </test> <edit mode"assign" name"antialias" > <bool>true</bool> </edit> </match>
Easy! Again, it's an entry in /etc/fonts/local.conf. Technically this just adds the "preferred" font in front of the list of names to be used, so it's not 100% guarenteed in the case of a missing font.
<alias> <family>Helvetica </family> <prefer><family>Bitstream Vera Sans Mono</family></prefer> <default><family>fixed</family></default> </alias>
By default, fontconfig 2.3.2-4 and higher will disable the use of bitmap fonts. This setting is managed in /etc/fonts/conf.d/10-no-bitmaps.conf, or in higher versions, /etc/fonts/conf.d/10-bitmaps.conf. To enable bitmap fonts and keep them enabled after upgrades of fontconfig, place a symlink from yes-bitmaps.conf to 10-bitmaps.conf, overwriting the symlink to no-bitmaps.conf.
The only two fonts that you absolutely have to have in order to start X are 'cursor' and 'fixed', both of which are in the fonts/misc directory. If you want to get rid of all the pixel fonts besides these two, you can delete all the files in the misc directory besides cursor.pcf.gz and all the fonts that are similar to either 9x18.pcf.gz or 9x18-ISO8859-1.pcf.gz. When I deleted all the fonts besides those from the misc directory, I had about 337 files still in it, so if you have a lot less than that you should probably put them back before restarting X.
No need to recompile. Freetype's internal auto-hinting is just shut off. To force the autohinter to be on, add the following to /etc/fonts/local.conf or ~/.fonts.conf
<match target="pattern"> <edit name="autohint" mode="assign"> <bool>true</bool> </edit> </match>
Someone else has a different opinion … The bytecode interpreter is supposed to beat the autohinter by a long shot so i don't see why anyone would want the autohinter.