Adding TrueType fonts is a little more difficult, because you need to have a font server that is capable of serving TrueType fonts. Two font servers that do this are xfstt and xfs.
xfstt
is a TrueType font server. While it's easy to configure,
and quite useful, it appear that xfs
is becoming more popular.
The main advantage of xfs
over xfstt
is that it supports
both Type1 and TrueType fonts.
To set up xfstt, just download it and install it. If you have an rpm based distribution, there is a well packaged version of xfstt at http://independence.seul.org/. Once you install it, you need to do the following:
xfstt --sync
. This causes it
to look for the fonts and create the fonts.dir
file. unix/:7100
to your font path.rpm -ql xfstt |grep init
and look for the
file with a name something like this: /etc/rc.d/init.d/xfstt
)
If you don't have an init script, just
put two lines in /etc/rc.local
like this:
/usr/X11R6/bin/xfstt --sync /usr/X11R6/bin/xfstt &
Some of the newer Linux distributions ship with the X font server
xfs
configured to run as a stand alone program.
Notably, Redhat and all the redhat based distributions use this
modularised xfs
with TrueType compiled in.
Debian also ship xfs
, but the version
they ship doesn't have built in true
type support.
Running xfs
as a stand alone server has several benefits, especially
if it is compiled with TrueType support. The main advantage is that since
the font server is no longer attached to the X server, it is possible
to serve fonts to remote displays. Also, it makes it much easier
to modify the font path.
xfs
PathAs a font server, xfs
has it's own font path.
One might wonder where this fits into the picture. It
works like this: you can place the xfs
font server
in XFree86's font path, by adding unix/:port
to
the XFree86 font path.
Once you do this, any font in the xfs
font path
automatically becomes available to XFree86.
The xfs
font path
is determined by the xfs
configuration file,
which is /etc/X11/fs/config
on Redhat, and
/etc/X11/xfs/config
on Debian.
Redhat users do not need to explicitly edit this file, they
can use the chkfontpath
utility.
The syntax is simple:
chkfontpath --add directoryUsers of other distributions can edit the configuration file as follows:
catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled, ... /usr/share/fonts/my_new_fonts/, ... /usr/share/fonts/some_other_directory # in 12 points, decipoints default-point-size = 120 ...The above would add
/usr/share/fonts/my_new_fonts/
to the
xfs
font path. Note that the last line of the list of
directories doesn't have a comma at the end.
For these modifications to the font path to become effective, xfs
must be restarted. It's also a good idea to restart your
X session after restarting
xfs
.
xfs
To prepare a font for xfs
, you need to follow the following
steps:
type1inst
in the directory.ttmkfdir -o fonts.scale mkfontdirin the directory containing your new fonts.
ttmkfdir
is part of the freetype package.xfs
search path.
Users of Redhat-like distributions
can do this with the chkfontpath
utility:
Other users can do this by editing their xfs
configuration
file.xfs
is already installed on your system,
you should see which port it is running on. You can do this
as follows:
ps ax|grep xfs
xset -q
unix:/port_number
were port_number is the port which the server is running on, then
you already have xfs set up properly. Otherwise, you should add it to
your XFree86 font path.
xset fp+ unix/:port_number xset fp rehashYou can add it permanently by editing your
.xinitrc
as explained
previously.
To add it system wide, edit your XF86Config file ( probably either
/etc/X11/XF86Config
, /etc/XF86Config
or
/usr/X11R6/lib/X11/XF86Config
), by adding a
line FontPath "unix:/port_number"
in the Files section.
Here's an example:
Section "Files" ... FontPath "unix/:-1" ... EndSection ...
xfs
is already properly installed, then you can restart
it like this:
/etc/rc.d/init.d/xfs restart
xfs
, it's a good idea to restart your
X-session.