using dejavu fonts with x11-xorg

by Martin Monperrus

This document presents how to use DejaVu fonts with x11:

1. Ensure that the freetype module is loaded by X (Load "freetype" in the section "Module" of xorg.conf)

2. Add the directory containing the TTF files of Dejavu (FontPath "/usr/share/fonts/truetype/ttf-dejavu" in the section "Files")

3. Create fonts.scale with ttmkfdir.
$ cd /usr/share/fonts/truetype/ttf-dejavu/ && ttmkfdir

4. There is a bug in ttmkfdir, fonts are defined as "character cell" (field spc set to "c"). Change them to proportional (p)
$ sed -i -e "s/-c-/-p-/" fonts.scale

5. Create the fonts.dir file
$ update-fonts-dir /usr/share/fonts/truetype/ttf-dejavu

6. Restart X and/or rehash the font path ($ xset fp rehash)

Thanks to Peter Grandi for the diagnostic!

Tagged as: