Adding TrueType font support to XFree86
TrueType font support is now built into XFree86. The following items need to
be completed to make the fonts available.
Establish a directory for the fonts and move any TrueType fonts
you want into that directory.
Create the fonts.scale and
fonts.dir files in the TrueType font directory.
Ensure the truetype module is loaded in
XF86Config.
Ensure the FontPath in
XF86Config contains the TrueType font directory.
Establish a TrueType font directory
The build of XFree86 as given above automatically creates a TrueType
font directory: /usr/X11R6/lib/Xll/fonts/TTF. This
directory is already has some TrueType fonts and is set up correctly.
If this directory is satisfactory, copy any other TrueType fonts you want
into that directory. If not, create a new directory, preferably in
the /usr/X11R6/lib/Xll/fonts/ directory and put
your TrueType fonts there.
Create fonts.scale and
fonts.dir
To make the fonts.scale file, you have to build the
program ttmkfdir. Unfortunately, this program needs
libraries from the freetype project, so we need to make
that first.
Download location:
Unpack the file and build with
./configure --prefix=/usr &&
make &&
make install &&
ldconfig
Now build the ttmkfdir utility.
Download location:
The filename is ttmkfdir.tar.gz.
This is a very short program that unpacks it is files in the current
directory, so its best to make a separate directory.
mkdir ttmkfdir &&
cd ttmkfdir &&
tar zxvf ../ttmkfdir.tar.gz
Edit the Makefile to make the following changes:
FREETYPE_BASE=/usr
FREETYPE_INCL=$(FREETYPE_BASE)/include/freetype
FREETYPE_LIB=-L$(FREETYPE_BASE)/lib -lttf
Run
make &&
install -m755 ttmkfdir /usr/bin
Now change to the directory where you have your TrueType fonts and run
ttmkfdir -o fonts.scale &&
mkfontdir
Ensure TrueType is loaded in XF86Config
The "Module" section should look like:
Section "Module"
...
Load "freetype"
Load "speedo"
EndSection
Ensure the FontPath in
XF86Config points to the TrueType font directory
The "Files"section should look like
Section "Files"
...
FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
EndSection
XFree86 will now be able to use TrueType fonts when it is restarted.
You can check to see if the new fonts are available with the
xlsfonts program.