Make your own free website on Tripod.com

Home

Font beautification

The purpose of this document

The purpose of this document is to get you acquainted quickly with fonts in Linux and help you use
True type fonts ("One of the few things Windows is good for").This document does not hope to help
you Understand Fonts under X.There is an excellent Font-HOWTO and a mini HOWTO.Please refer to them
for further info.This document itself derives many ideas from them.

Action

The first place to look for any font related problems is your XFree86 Config file, usually at
/etc/X11/XF86Config(XF86Config-4 in case X 4.x).Goto to the section marked "Files".You should see
something like

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/75dpi/"
or just
FontPath "unix/:7100"
if your font needs are satisfied by xfs.

The FontPath tells X where to look for fonts to render text.The order is very important.When ever an
application asks for a font X just searches the FontPath and the first font that matches the
criteria is rendered.

XFS

Redhat from 5.x onwards started shipping with xfs(x font server) that handles all the Font needs.The
FontPath section now looks like

For RedHat 7.x
FontPath "unix/:7100"
and Redhat 5.x
FontPath "unix/:-1"
The service is given via Unix Domain socket and the number specifies the port in which the server is
running.xfs has its own configaration file, located at /etc/X11/fs/config.The location of fonts is
given in this file.

Adding True type Fonts

Most of the web pages out there on the web are written for Windows users(alas) and they use True
type fonts which unfortunately are not supported naturally by X.So tweaking becomes necessary.
True type fonts are scalable so they look great at any size.Follow these steps and you'll be using
true type fonts in your linux system

Step 1
Copy the true type fonts from a CD or floppy or from a Windows partion to a suitable place
say
/usr/X11R6/lib/X11/fonts/ttf
Step 2
Issue the following commands
ttmkfdir > fonts.scale
mkfontdir
Now you should have 2 files fonts.dir and fonts.scale in that directory.

Step 3
Now the final step is to make these fonts available to X.If you are not using xfs and X serves your
fonts directly edit XF86Config and add the path to the font dircetory in the files section, as in
FontPath "/usr/X11R6/lib/X11/fonts/ttf"
FontPath "/usr/X11R6/lib/X11/fonts/misc/"
FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/"
But if you are using xfs(as mostly thats going to be the case) edit the file /etc/X11/fs/config and
find the section catalogue which would look something like
catalogue =/usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
/usr/X11R6/lib/X11/fonts/Type1
Now add the directory containing the truetype fonts
catalogue = /usr/X11R6/lib/X11/fonts/ttf,
/usr/X11R6/lib/X11/fonts/misc:unscaled,
/usr/X11R6/lib/X11/fonts/75dpi:unscaled,
/usr/X11R6/lib/X11/fonts/100dpi:unscaled,
/usr/X11R6/lib/X11/fonts/Type1,

Another simple strategey would be to simply place symbolic links to true type fonts in windows
partitions without actually having to copy them.And then follow the usual steps to create
fonts.scale and fonts.dir.Obviously you should have Windows partition mounted at startup.Mandrake users can use the XFontDrake, a nice, pretty GUI tool for font management, to set up fonts.

Thats it.Restart X and You should be able to use True type fonts under X Window.

More info can be had from

The Font Howto
XFree86 Font Deuglification Mini HOWTO
Understanding fonts.scale, fonts.alias,etc.,