X11 has several ways of handling fonts, depending on the type of font and the X Server you are using. This guide teaches you about the different types of fonts, how to modify your font path (in four(!) different ways), and how to install several different types of Fonts. New in this version is support for all PowerMac Linux X Servers, clarifications, corrections, and more.


Sections

  • Types of Fonts Supported by X11
  • Introduction to Platform Compile Fonts
  • Fixed .pcf is Required to Run X11
  • Configuring Font Paths
  • Adding Fonts
  • Getting Fonts

    Types of Fonts Supported by X11

    Bitmap/Fixed Fonts:

  • .pcf - Platform Compiled Fonts
  • .spd - Speedo - Bitmap Cross Platform Fonts

    Scalable Fonts:

  • .pfb - Postscript Type 1 Fonts.
  • .ttf - Windows Datafork-only TrueType Fonts.

    Introduction to Platform Compiled Fonts

    Platform Compiled Fonts are exteremly fast, and are used where speed counts. This includes mouse pointers, xterm fonts, and the default font.

    As the name indicates, they a platform specific, a i386 .pcf font won't work on the PowerPC. You must get the font's sourcecode, and compile it.

    Fixed .pcf is Required to Run X11

    To run most X Servers you'll need to have a .pcf font called 'fixed' installed. It lives in the /usr/X11R6/lib/X11/fonts/misc directory.

    You most likely already have it installed, as it in the base XFree86 package (or in Debian xfonts-base). It is almost always installed with X11, however X11 may not be able to find it, if X11 is supplied with a bogus font path (location of fonts).

    A bogus font path is caused by one of the font directories being listed being invalid. Just having one invalid font directory, will break the entire font path. So if your font path has one directory listed with no fonts in it, X will just give up. The X Font Server, forently does not suffer from this, more below.

    Not being able to find this font, causes X11 to give up, and die with an error similar to:

    Fatal X11 Error: default font 'fixed' could not be found.

    Try starting X11 with just the required "misc" directory that contains the "fixed" font. You can tell X11 what fonts to load by using the -fp (font path) flag. You must put two dashes and a space before it, when running startx, to tell startx to pass those arguments to the X Server you are running.

    startx -- -fp "/usr/X11R6/lib/X11/fonts/misc"

    If X starts up properly, then it's a font path problem.

    Configuring Font Paths

    Font paths are supplied to X in one of four ways:

  • Default Font Path, Hard Coded into X Server.
  • Font Path Supplied by XF86Config.
  • Font Path Supplied by the -fp flag passed to the XServer.
  • An X Font Server.

    Default Font Path

    If you don't specify (or have specfied) a font path in XFree86 and don't start X using the -fp flag, X will automatically use the default paths for fonts.

    "/usr/X11R6/lib/X11/fonts/misc,/usr/X11R6/lib/X11/fonts/100dpi,/usr/X11R6/lib/X11/fonts/75dpi, /usr/X11R6/lib/X11/fonts/Speedo,/usr/X11R6/lib/X11/fonts/uwm"

    XF86Config

    You can put fonts to be displayed in XF86Config (if you are using a XFree86 server, and not Xpmac) in the below format (look for it in XF86Config):
    Section "Files"
            RgbPath "/usr/X11R6.4/lib/X11/rgb"
    
            FontPath    "/usr/X11R6.4/lib/X11/fonts/misc/:unscaled"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/75dpi/:unscaled"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/100dpi/:unscaled"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/local/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/Truetype"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/Speedo/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/Type1/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/CID/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/misc/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/75dpi/"
            FontPath    "/usr/X11R6.4/lib/X11/fonts/100dpi/"
    EndSection
    

    The -fp Flag

    Before the days of the XF86Config file, users used to have to specify fonts by using the -fp font path flag. If you are using XFree86, just edit XF86Config instead.

    Note: You can setup startx to pass these arguments to X11 every time you startup. Place them in the quotes at the end of serverargs="" in the startx file -- /usr/X11R6/bin/startx.

    You can also do this with xdm/gdm/kdm. Edit /etc/X11/xdm/Xservers, and put your flags after :0 local /usr/bin/X11/Xpmac.bin vt7.

    Using X Font Server

    Almost everybody uses X Font Server (xfs) nowdays to server fonts to X. Both YDL and LinuxPPC do. Debian can use it, its found in the xfs-tt package. This takes some of the burden off of X, speeding things up, not to mention it is more flexable, and supports TrueType fonts.

    If you see unix/:-1 or unix/:7000 in XF86Config, in your font path, you are using xfs. If not, you can install the xfs and chkfontpath packages from your distro.

    Once xfs is running, you can check what fonts it is servering by chkfontpath --list.

    Adding Fonts

    X11 lacks a fancy font installer like Mac OS or Windows. Installing fonts is slightly more complex, after some experience it becomes easier.

    Once you have downloaded or recieved fonts from another machine, you should put them in a folder for inspection.

    You should check what kind of fonts you have. Then follow one of the following:

    Platform Compiled Fonts

    Make sure they are from a machine running a current version of PowerPC Linux. X11 can automatically ungzip them on the fly, so don't worry if they are compressed. If you can't get them for the PowerPC, get the source code for the font, and compile it. Most likely you will want to put this font in /usr/X11R6/lib/X11/fonts/misc/. Next, run mkfontdir.

    A collection of these is part of the XFree86 base package and the 75 and 100dpi package.

    Speedo Fonts

    For Speedo fonts, just copy them into /usr/X11R6/lib/X11/fonts/Speedo. They don't require special compilation. Next, run mkfontdir.

    There are a few of these in the XFree86 Speedo Package.

    Postscript and Bitstream Fonts

    For Windows Type 1 Postscript Fonts or Bitstream fonts, place them in /usr/X11R6/lib/X11/fonts/Type1. If you copied them from a MS Windows box, make sure they are all lowercase, otherwise X11 may refuse to load them. Next, run mkfontdir.

    You can find these in Type 1 package.

    TrueType Fonts

    Put them in /usr/X11R6/X11/fonts/truetype. If you copied them from a MS Windows box, make sure they are all lowercase, otherwise X11 may refuse to load them. Run mkttfdir -o fonts.scale. Next, run mkfontdir. If you are adding TrueType fonts for the first time, you may have to run chkfontpath --add /usr/X11R6/lib/X11/fonts/truetype, to add the fonts to your xfs path.

    Due to licensing problems, no TrueType fonts are included with Linux distros currently.

    Where to Get Fonts

    Convert Mac TrueType Fonts to Windows Format

    Do you want to use some TrueType fonts from Mac OS? You need to convert the Macintosh Resource Fork TrueType files to Windows Data Fork TrueType Fonts. You can either use one of the many commerical tools to do this, or use the ancient program.

    Note: TTConverter can not work with the TrueType fonts that come as part of the Mac OS (Chicago, Geneva, New York, etc.). You will have to use a commerical program to convert these.

    Microsoft Web Fonts

    Microsoft has an awsome collection of TrueType fonts. You can get them . You need to get the Windows 3.1 version, and expand them with unzip.

    Freeware Fonts on the Web

    There are lots of freeware fonts on the web, you can go to a shareware site, or use a search engine to locate some.

    Sharefonts and Freefonts

    These packages contain many nice fonts, especially for use in the GIMP.

    Please send feedback to . You may also post feedback below. This document is free for anyone to use in part or in whole.