How to use True Type fonts in FreeBSD

This assumes FreeBSD 4.x (4.2 at time of writing) and XFree86 version 3.3.6.

  1. Install a TrueType font server from ports:
    cd /usr/ports/x11-servers/Xfstt/
    make install clean
    
  2. Set the server to start at boot, by saving the following little script in /usr/local/etc/rc.d/ as xfstt.sh :
    #!/bin/sh
    [ -x /usr/X11R6/bin/xfstt ] && /usr/X11R6/bin/xfstt & && echo -n ' XFstt'
    
  3. mkdir /usr/X11R6/lib/X11/fonts/TrueType
  4. Add the following to the FontPath statement in your Xfree86 configuration file (in 3.3.6 this is /etc/XF86Config, and in 4.0.2 it is /etc/X11/XF86Config .):

       FontPath   "unix/:7101"
       FontPath   "/usr/X11R6/lib/X11/fonts/TrueType"
    
  5. Copy some Windows Truetype fonts from c:\windows\fonts or from the web, into /usr/X11R6/lib/X11/fonts/TrueType.
  6. Issue these commands inside /usr/X11R6/lib/X11/fonts/TrueType:
    #  /usr/X11R6/bin/xfstt --sync
    
    # /usr/X11R6/bin/xfstt & [this is unnecessary later, when xfstt is
    started at boot-time]
    
    # xset fp+ unix/:7101
    
  7. Restart X.
  8. You can now run xfontsel to see if X has registered your TT Fonts. To add more fonts, copy them into /usr/X11R6/lib/X11/fonts/TrueType and repeat the commands in step 6.
Your fonts should be usable in applications like Netscape, Opera and Gimp.