13.3. X11 Fonts.   

The default format font used by X servers was called SNF (server normal format), This default allows the X server to format the font on the disk, thus it can read the font quickly. The important element of the SNF format is that it was not a portable format; it depended on the architecture of the machine running the server and as a consequence you needed different directory structure for different system on your network. On top of that, several systems vendors implemented their own font format, making font portability even more difficult. This type of format applied until X11 release 4 (X11R4).

It was just when X11R5 released where fonts were treated by X Consortium. Using this format, two things were changed: the font service protocol was defined as a standard and interoperatable way for an X server to obtain fonts (independent of their format, origin, or current location on disk), and the default format for stroing fonts was changed from SNF to PCF (portable Compiled Font). PCF was origilnally developed by DEC. Its primary advantage is it is not architecture dependent. Thus, by compiling a font to PCF format on different systes, it may end up having two different PCF files. Fortunately, for X11R5 system is enable to read the other's file correctly. X Consortium has created a network-based standard font protocol. With the X Font Service protocol, you just tell your X server that it must use the services of a font server, which is a daemon process sitting on a host on your network. The font server is a program which talks a standardized protocol on the network, and which is capable of reading several font formats.

The font server sources are modular, such that it is easy to add a renderer for an additional font format to the existing code. This is obviously also the intention: the X Consortium provides the core technology, and supposes that all systems vendors will add font renderers for their proprietary formats to the code, and then ship that to their customers.

If you have a multi-vendor environment, then you are supposed to run a font server on every host that carries the font files. Then all of the X servers on your network can put all the fonts they need in their font path. Automatically, IBM fonts will be requested from the font server on an IBM host, DEC fonts from a DEC host, etc. Other benefits of using font server technology include the ability of the font server to implement caching, provide for fault-tolerant setup, etc.

A final example of the good use of the font server is the combination of a font server with a Type 1 font renderer. As mentioned above, IBM donated a Type 1 font renderer which can easily be built into the X font server. As the Type 1 font format, and the ATM format are the same, it is perfectly possible to use commercial ATM fonts with the X Window System.

The X11R6 font server is very similar to the X11R5 server described above. Under X11R6, the font server has been renamed to xfs and the Type 1 rendering engine is now incorporated into the base distribution--it is no longer a contributed package.

There are many different font formats that can play a role in an X11 system configuration. The following summarizes some of the common formats:

BDF The Bitmap Distribution Format (BDF) is the standard format for distribution of fonts. It is an ASCII format so it can easily be edited it with your favourite editor or E-mailed to other users. As the name suggests, it stores bitmap fonts only.
Another virtue of the BDF format is that most font format converters convert to or from this format. Means if you want to go from format A to format B, neither of which is BDF, then you are likely to convert A to BDF, then BDF to B.
The BDF format is defined by Adobe. A document describing the format is available by ftp from Adobe's file server at "ps-file-server@adobe.com". It is also available in the standard X distribution. Look under X11R4(5)/mit/hardcopy/BDF. This document is also reproduced in any text describing the X standard.

SNF The Server Normal Format (SNF) is an older format for bitmap fonts. The format is X Server and host dependent. This means that if you have two SNF files, their actual format may be different. Also, if you have an "snftobdf" utility, it may not be able to read font files from other systems. Convert to BDF format before you move it off the host system.
Snftobdf is one utility that can generate a BDF file from a SNF file. It was part of the X11R4 contrib release. To compile under X11R5, you need some of the X11R4 snf include files.

PCF The Portable Compiled Font (PCF) format is a binary format for bitmap fonts. The binary contains sufficient information to be readable by other systems.

PHIGS
These fonts are only applicable in PEX environments. PHIGS fonts don't really have any relationship to the normal X font mechanism.

DWF The DECWindows Fonts (DWF) are bitmap fonts.

Intellifont
These are HP scalable fonts.

PFA/PFB
These are Adobe Type 1 PostScript fonts. They can be used in X11R5 based X servers and font servers because IBM has donated a renderer for this format to the X Consortium. The renderer can be found on the X11R5 contrib, and on ftp.x.org.

Speedo
This is a format from Bitstream, Inc. Bitstream has also donated a font renderer to the X Consortium, and a couple of fonts. It has been told that in order to use commercial fonts from BitStream, you must patch the renderer somewhat to make it use the right description code for the font.

FB These are Sun X11/NeWS format bitmap fonts used by the Sun OpenWindows system. You can use "convertfont" which comes with OpenWindows to convert to/from BDF.

F3/F3B
This is the scalable Sun Folio format, also used by OpenWindows. You can use "convertfont" to convert to (not from) BDF.

13.3.1. Conversion software   


PC format bitmaps:
Conversion to BDF is possible from TeX PK format and LaserJet softfont format. Other conversions are also within the realm of possibility.

TeX PK format bitmaps:
PKtoBDF gets us directly to BDF format from here.

Mac format PostScript:
Under MS-DOS, conversion to PC format PostScript allows the font to be accessed with PS2PK (under Unix or MS-DOS).

PC/Unix format PostScript:
Conversion to TeX PK with PS2PK allows you to get to BDF (indirectly).

XtoBDF, getbdf, FStoBDF:
XtoBDF and getbdf are two public-domain applications which are capable of asking an X server to give them all it knows about a given font. They then print the BDF representation of that font on stdout.