Installing New Fonts to X Window System

What does one have to do to have ISO 8859-2 fonts installed on her (or his) computer? Below, you can find a step-by-step tutorial. Please don't hesitate to email me if you have any additions, corrections and comments about it.

Contents

  1. Linux/XFree86
  2. Hewlett-Packard
  3. Sun Microsystems
  4. Possible problems

Linux/XFree86

  1. Download the fonts. Connect to your nearest FTP site and download the fonts to your local hard disk. Uncompress (un-gzip) and un-tar them. You might want to chech one of the following font repositories.
  2. Find the place in your directory tree where you would want to install them to. The usual place is /usr/lib/X11/fonts/ and the subdirectories therein. In this tutorial, /usr/lib/X11/fonts/iso_8859.2/ will be used as an example directory.
  3. X server cannot use the fonts in the form they are distributed: from the BDF (Binary Distribution Format) we have to convert them to PCF (Portable Compiled Format) using the program bdftopcf that is shipped with every X Window System (n.b. X Window System 11 Release 3 and older use SNF - Server Native Format - instead of PCF, so one has to use another utility there, namely bdftosnf. The little piece of shell script will do the trick:
          for FILE in *.bdf
          do
    	bdftopcf $FILE -o `basename $FILE .bdf`.pcf
          done
          
  4. As a rule now, X servers can use fonts compressed, so we can compress *.pcf
  5. Next, we have to build the font directory fonts.dir, which contains the relation between the font properties and their names. In each subdirectory of /usr/lib/X11/fonts/ there has to be a fonts.dir file:
          mkfontdir
          
  6. Now we are ready to inform the X server about the new fonts. With xset we can change various preferances; right now we are only interested in the font path.
          xset +fp /usr/lib/X11/fonts/iso_8859.2/
          xset fp rehash
          
    If everything went fine, xlsfonts *-iso8859-2 should now list all the newly installed fonts.
  7. We would want now to make the changes permanent. The XFree86 X Window server on a Linux keeps its configuration in /usr/X11/lib/X11/XF86config (/usr/X11/lib/X11/Xconfig in some older versions). We have to find the part of the file where the font path is specified and add another line:
          FontPath "/usr/lib/X11/fonts/iso_8859.2/"
          

We are done now. The next time we will run X Window system, X server will load the appropriate font path.


Hewlett-Packard

(Mark Martinec, National Supercomputer Center, Ljubljana, <mark.martinec@nsc.ijs.si>,
Ales Casar, University of Maribor, <casar@uni-mb.si>)

HP-UX Version 9.05

HP-UX version 9.05 (9.03 and earlier not!) has font path /usr/lib/X11/fonts/iso_8859.2/ built into the server. If you are running this version, you only have to repeat steps 1-5 above (also xlsfonts command from step 6 for testing purposes). The next time you will start X server, it will automatically find the fonts residing in /usr/lib/X11/fonts/iso_8859.2/ directory.

HP-UX Versions 10.01 to 10.20

With this version, the /usr/lib/X11/fonts/iso_8859.2/ directory has subdirectories denoting the resolution. Therefore you have to put your fonts into /usr/lib/X11/fonts/iso_8859.2/75dpi/ (or 100dpi, if you have fonts in this resolution) subdirectory, where X server will automatically recognize them.

All versions running HP VUE

Another possibility is specifying additional font paths in /usr/vue/config/Xconfig:

############################################################################
#  To append additional elements to the X server's font path at X startup.
#  NOTE: This resource causes two additional arguments -- "fp+" and this
#  resource's definition -- to be appended to the X server invocation string
#  (see the Xservers file).  If any server in Xservers is unable to process 
#  this option, this resource should not be used.
#
Vuelogin.fontPathTail:  /usr/lib/X11/fonts/iso_8859.2

Sun Microsystems

(Gorazd Bozic, Academic and Research Network of Slovenia, Ljubljana, <gorazd.bozic@arnes.si>)

Solaris 2.x

Create fonts in directory /usr/openwin/lib/X11/fonts/iso_8859.2 following steps 1-6 above. To start each X session (xset works only for the current session), copy /usr/dt/config/Xconfig to /etc/dt/config/Xconfig and add to it:
##############################################################################
# Add ISO 8859-2 font directory (/usr/openwin/lib/X11/fonts/iso_8859.2)
# to FontPath.
##############################################################################
Dtlogin.fontPathTail:          /usr/openwin/lib/X11/fonts/iso_8859.2
You can now force dtlogin process to reread configuration file with command /etc/init.d/dtlogin reset.

Warning: Reseting dtlogin process will terminate your current X session!

SunOS 4.1.x/OpenWindows

SunOS uses Sun's own proprietary X11/NeWS format (suffix .fb) instead of PCF format. In the procedure described above, replace step 3 with running convertfont, which converts BDF to the X11/NeWS format:

        convertfont *.bdf
You copy the converted files onto some appropriate directory (e.g. /usr/openwin/lib/fonts/iso_8859.2), then instead of step 5 (mkfontdir) run bldfamily. This command creates a file with suffix .ff for each font family.


Possible problems

(Ales Kosir, University of Ljubljana, <kosir@lfdtb.fs.uni-lj.si)

You may get the following error message while executing xset command:

~> xset +fp /usr/lib/X11/fonts/iso_8859.2/
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  51 (X_SetFontPath)
  Value in failed request:  0x0
  Serial number of failed request:  4
  Current serial number in output stream:  6
~>
The error message is not very informative and possibly misleading. It may mean that either you have mistyped the directory name, or that an old or incorrect fonts.alias file is causing the troubles. Check whether you have correctly entered the directory name, and try to rename the fonts.alias file in that directory to some other name. Sometimes, you may even get this error message if you have executed the xset command from a directory other than specified. Change to the specified directory first and try executing it again:
~> cd /usr/lib/X11/fonts/iso_8859.2/
/usr/lib/X11/fonts/iso_8859.2> xset +fp `pwd`

Created 1996-01-07 by P. Peterlin
Last revision $Date: 2001/01/30 11:26:36 $ ($Author: gnusl $)
Back to ISO 8859-2 Resources