Geez, My Linux Netscape Fonts and Fonts in X Look Terrible

This question comes up so often I've decided to add a page. There is an excellent HOWTO
at...

http://www.tldp.org/HOWTO/mini/FDU/index.html 

On that page you'll find a lot of information. If you use Slackware you might have a problem
with ttmkfdir. However this page contains all the information you should need.

Also see...

http://freshmeat.net/projects/xfstt/?topic_id=850  For a different type of solution that doesn't
use ttmkfdir. Both work but IMO using ttmkfdir iis the better option.


If you can not build ttmkfdir from the source go to here for a precompiled binary of ttmkfdir or
xfstt.

ftp://rsgibson.com/pub/linux

Instructions for using TTMKFDIR

Note: xfstt contains al the info you need. However I'd strongly suggest that you modify you X
configuration as below, moving the 100 DPI and TT fonts to the beginning of the font path.

Configuring and installing Making it work: Font Server Support

Once you've gotten XFree86 4.0 up and running, you'll probably want to start using your
favorite TrueType fonts from Microsoft Windows or the Internet.


The first thing you'll need to do is make sure that the TrueType XFree86 module is running on
your system.

Step 1: Edit

Edit the file /etc/X11/XF86Config with any text editor. Make sure the following statements are
in your "Module" section:

This loads the freetype open source TrueType font module for Linux, as well as the Adobe Type 1
fonts that are used on Macintosh and Windows systems.

Section "Module"
# This loads the Type1 and FreeType font modules
Load "type1"
Load "freetype"
EndSection

Step 2: Add A New Directory

Next, you'll want to add a new directory to your X font path in the following section. Save the file
and close your editor. If you had to modify XF86Config, you should restart your X server by hitting
ctrl-alt-backspace.

FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/truetype"

MY NOTE: At this point another change should be made. This comes from one of the HOWTO
mentioned earlier. Change the font paths so the freetype and 100DPI fonts appear first like so
no matter which method you use...

FontPath "/usr/X11R6/lib/X11/fonts/truetype"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/misc/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/local/"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/Speedo/"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"

After this is done you should use this option for whatever X server you are using...

startx -- -dpi 100

Step 3: Create A New Directory

Next, you'll want to create a new directory under /usr/X11R6/lib/X11/fonts called truetype.
Simply type the following commands from the prompt

cd /usr/X11R6/lib/X11/fonts
mkdir truetype   ...if it doesn't exist

Step 4: Transfer Your Truetype Fonts

You'll now want to transfer your TrueType fonts to this directory. Since I have a LAN at
home, I simply FTPed the TTF files from my Windows 2000 workstation's WINNT\fonts
directory to a temporary subdirectory on my /home mountpoint, and copied them using
KFM. If you have a windows installation simply copy the TT fonts into your Linux truetype
directory.

Step 5: Make Your Truetype Fonts Usable

To make the TrueType fonts in /usr/X11R6/lib/X11/fonts/truetype usable under XFree86 4.0,
you need to use a utility called ttmkfdir, which you can download from Freshmeat.net, . What
ttmkfdir does is scan TrueType fonts and create index files, or font.dir files, which XFree86
reads to catalog your list of fonts, and make these accessible to all of your X applications.
The archive file ttmkfdir.tar.gz contains the source code. The precompiled binary for Intel Linux
machines named ttmkfdir.linuxbin.glibc2 is sometimes included. If not get it precompiled from
my website. Rename this file to ttmkfdir and copy it to your /usr/bin directory.

To index your TrueType files just CD to /usr/X11R6/lib/X11/fonts/truetype and use the following
command (s):

CD /usr/X11R6/lib/X11/fonts/truetype
ttmkfdir > fonts.dir
ttmkfdir > fonts.scale


Or better yet...

After changing to /usr/X11R6/lib/X11/fonts/truetype

ttmkfdir -o fonts.scale
/usr/X11R6/bin/mkfontdir -e /usr/X11R6/lib/X11/fonts/encodings

This generates both fonts.dir and encodings.dir files in the current directory.

For even more fonts see http://www.fontmaster.com

Step 6: Make Fonts Available

To make the fonts available to your GUI programs, you have to shut down and restart X. And
there you have it -- you should be able to access your TrueType fonts from any X application.