Close this Window Print this Article EasyCopy
Adding fonts to your X server


You need a Type 1 .pfa file, and a corresponding .afm font metrics file.

If you have a True Type font these files can be created by a free utility program "ttf2pt1". F.ex.

ttf2pt1 -e myfont.ttf

will create myfont.pfa and myfont.afm.

Put all the .pfa and .afm files that you want to add to your Xserver in a directory without any other files.

On Solaris you first need to run mkpsres to create a PSres.upr file in your font directory. This is not needed on other platforms.

Next you need to create a fonts.scale file in your font directory that contains the mapping of an internal X11 font name (XLFD) to a known font file.

Here is an example with 4 Type 1 courier fonts:

cat fonts.scale
4
cour.pfa -adobe-courier-medium-r-normal--0-0-0-0-p-0-iso8859-1
couri.pfa -adobe-courier-medium-i-normal--0-0-0-0-p-0-iso8859-1
courb.pfa -adobe-courier-bold-r-normal--0-0-0-0-p-0-iso8859-1
courbi.pfa -adobe-courier-bold-i-normal--0-0-0-0-p-0-iso8859-1

Next run mkfontdir to create fonts.dir, which for Type 1 fonts is a copy of the fonts.scale.

To use this font directory with your X server you need to add the font path and tell X to update the font information:

xset fp+ /myfontpath
xset fp rehash

Then any X application like ecx should be able to use these fonts.
Copyright © 1995-2005, AGI (autoGraph international). All rights reserved. www.augrin.com