HOW TO INSTALL AND USE TRUETYPE FONTS UNDER LINUX
(C) 2004-2005 Daniel Brodzik
This document is released under the terms of the GNU Free Documentation License as published by the Free Software Foundation, either version 1.2 or (at your option) any later version, with no front-cover texts, no back-cover texts, and no invariant sections.
INTRODUCTION
This document explains how to add and remove TrueType fonts under older Linux distributions. These fonts are most commonly found on Microsoft Windows machines, but they are also useful on Linux machines. Once installed, the fonts will be usable under any X11 (GUI) program that supports installable fonts (like OpenOffice.org). This guide assumes that you are using XFree86 4.x, which is the one shipped with most recent Linux distributions. If you are using an earlier version of XFree86 or another X server altogether, these instructions may or may not work for you. If in doubt, please consult the documentation for your X server.
IMPORTANT NOTE: If you are using a more recent distribution (released after 2002), you probably will have an easier method to do this available. For example, in Mandrake 10.x, you can just open up a Konqueror window under KDE with the URL of "fonts;/", go into "System", and just copy your fonts somewhere in there. If you don't like KDE, you can just copy the fonts to /usr/share/fonts. That's all there is to it. If you have one of these newer Linux distributions (with XFree86 4.3 or later or Xorg 6.x or later), try one of these methods first before reading the rest of this guide.
PART I: FIRST THINGS FIRST
Since this is probably your first encounter with installing fonts on Linux, you will have to check that things are set up correctly. First, log in to a console session as root (try <Alt><N> first at the graphical login prompt because it exits X. If that doesn't work, then press <CTRL><ALT><F1> at the graphical login prompt if necessary). Next, type 'cd /etc/X11' (case sensitive and without the quotation marks). Next, type 'nano XF' and press <Tab> right away (this trick is explained in my Bash prompt guide). This should give you 'nano XF86Config-4'. If not, type the rest of it. Press <Enter> if you haven't yet done so. Now, check in the 'Files' section for the following line:
FontPath "/usr/lib/X11/fonts/TrueType"
If it's missing, add it in. Next, look in the 'modules' section for the following line:
Load "freetype"
If that's missing, add that in as well. If you see this line under 'modules':
Load "xtt"
then remove it. This TrueType engine does NOT work at all on my computer. You may or may not be able to use it. FreeType also seems to be more mature than xtt. Anyway, once you make these changes (if they were necessary, that is), press <Ctrl><O> and then <Enter> to save (or "WriteOut") the file. Then, press <Ctrl><X> to exit.
Next, you'll want to make sure that the utility ttmkfdir is installed. Try typing 'ttmkfdir' at the command prompt. If you get a 0 or something besides 'command not found', then you're all set. If not, then install it. Under Debian, this can be done by typing 'dselect' and selecting the package. Press </> and type 'ttmkfdir' to find that package, and press <+> to select it.
Note that you don't have to do this first part every time you install TrueType fonts. Anyway, now that we have everything installed and set up correctly, let's get those fonts installed!
PART II: INSTALLING TRUETYPE FONTS
This is pretty easy. First, find some fonts you wish to install. Log in as root to a console session (<CTRL><ALT><F1>). Copy or move them to the directory '/usr/lib/X11/fonts/TrueType'. To do that, use the cp or mv commands. Alternatively, you can use 'ln -s' to link them to that directory to save hard drive space, but make sure you don't delete the fonts by mistake. After that, type 'cd /usr/lib/X11/fonts/TrueType'. Next, type 'ttmkfdir > fonts.dir' and then 'ttmkfdir > fonts.scale'. Now, what you'll have to do depends on how you got to the console. If you pressed <Alt><N>, then simply type 'clear;logout' and wait about 5-10 seconds. If you pressed <Ctrl><Alt><F1>, then you can log in as root and type 'reboot' to restart X. When you re-enter X, your TrueType fonts should be listed in the font menus of your X11 (GUI) applications.