The X server depends on downloading fonts from hosts to satisfy most client font requests.
After locating the requested font, the X server displays the requested characters in client windows.
Terminals also have built-in fonts to use with initial installation or to use with clients in case downloaded fonts are not available, and terminals have a default font for clients that do not request fonts.
Font Access Sequence
An NCD terminal accesses fonts in the following order:
If the font is not in use, the X server checks its font cache to see if the font was in use and was closed. A font is placed in the font cache after it is closed by the last client using it. If the font is in the cache, the X server retrieves it to satisfy the new font request.
If the font is not in use and not in the cache, the X server checks each element (font directory or font server) in its font path.
If the font is not being handled by a font server, the X server directly opens the font file and reads it over the network into terminal memory.
An XLFD name consists of 14 fields separated by hyphens. The fields in the following example font name are described in Table 7-1:
-adobe-courier-medium-r-normal--8-80-100-100-m-50-iso8859-1
-*-fixed-bold-r-normal--13-120-*-*-*-*-*-*
-misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1-misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
Wildcards provide flexibility because a usable font can be substituted if the intended font is not found. A complete font name specification with no wildcards may cause a client to fail if the X server cannot find the font that exactly matches the specification.
Bitmap and Outline Font Naming
-*-courier-*-*-*--0-0-0-0-m-0-*-*
xterm*boldfont: -adobe-courier-bold-r-normal--20-140-100-100-m-110-iso8859-1
%
xterm -fn -adobe-courier-bold-r-normal--20-140-100-100-m-110-iso8859-1
% xterm -fn '-*-courier-bold-r-normal--20-140-*-*-*-*-*-*'
-*-helvetica-bold-o-*-*-*-120-*
-*-courier-*-*-*--0-0-0-0-m-0-*-*
You can obtain X fonts from vendors of the X Window System, from font vendors, and from the public domain. In addition, your host computers may already have fonts installed on them. Fonts must be in a format that the terminal can use. (See "Font Formats".)
The NCDware distribution also includes outline, or scalable, fonts. For information about outline fonts, see "Usable Font Formats with a Font Server".
Font Download Methods
By default, an NCD terminal searches for fonts on the boot host (the host from which the X server is downloaded). If you have set up initial file server hosts, the terminal also searches for fonts on the initial file servers.
Considerations in Using Downloaded Fonts
The font path uses terminal memory so you should include in the font path only the directories required by clients you are running.
Problems with Client Font Requests
Problems with client font requests can be overcome by changing the font path, using font aliasing, using X resources to change the fonts requested by the client, using wildcards in font requests, or installing the fonts needed by the client.
The Font Path
Fonts are usually stored in subdirectories of the /usr/lib/X11/ncd/fonts directory. The default font path for NCD terminals assumes all fonts are located in subdirectories of this directory.
Font Formats
The format of a font is revealed by its filename extension. The font formats a terminal can use depend on whether the terminal is using a host-based font server. For information about fonts you can use with the NCD font server, see "Usable Font Formats with a Font Server".
Without a font server, NCD terminals use only bitmap fonts. NCD terminals use the bitmap formats listed in Table 7-2, in either uncompressed or compressed format.
Table 7-2 Usable Font Formats without a Font Server
Bitmap fonts are often distributed in BDF (Bitmap Distribution Format), the format used to exchange fonts between systems. BDF fonts are stored as ASCII text. If you are not using a font server, you must convert BDF fonts to a binary format, such as PCF or SNF, before the terminal can use them. A utility for converting BDF to PCF is included in the NCDware distribution. For information about conversion from BDF format, see "NCD Font Management Utilities".
Font Directories and Files
Fonts are organized into font directories. Font directories contain font files and font management files. Font management files are used to locate font files.
Font Directories
Table 7-3 lists the bitmap font directories on the NCDware distribution and describes the fonts in each directory. When using TFTP to access fonts, font directories must be world-executable. When using NFS, permissions may differ. For more information about using TFTP and NFS, see Chapter 5, Configuring Network Services.
Table 7-3 Bitmap Font Directories
Font files are compiled in a specific format and must be world-readable. The name of a font file usually indicates the font family, weight, and size of the font and the font format. Font files supplied by NCD are compressed using 12-bit compression. If you add compressed font files, you must use 12-bit compression.
Font Management Files
Font management files enable the X server to locate font files.
The fonts.dir File
200
courBO08.snf -adobe-courier-bold-o-normal--11-80-100-100-m-60-iso8859-1
courBO10.snf -adobe-courier-bold-o-normal--14-100-100-100-m-90-iso8859-1
courBO12.snf -adobe-courier-bold-o-normal--17-120-100-100-m-100-iso8859-1
courBO14.snf -adobe-courier-bold-o-normal--20-140-100-100-m-110-iso8859-1
courBO18.snf -adobe-courier-bold-o-normal--25-180-100-100-m-150-iso8859-1
courBO24.snf -adobe-courier-bold-o-normal--34-240-100-100-m-200-iso8859-1
The first line in the file lists how many bitmap fonts or outline fonts are described by the file. The rest of the file lists the filenames and XLFD names for all the files in the directory. The .snf filename extension shows the format in which the font is stored. For more information about font formats, see "Font Formats".
The font directory management files in bitmap font directories are not designed to be edited by hand. Use the ncdmkfontdir(1) utility. Font management utilities are included on the NCDware distribution; their use is described in "NCD Font Management Utilities".
The fonts.alias File
lucidasans-8 -b&h-lucida-medium-r-normal-sans-11-80-100-100-p-63-iso8859-1
lucidasans-10 -b&h-lucida-medium-r-normal-sans-14-100-100-100-p-80-iso8859-1
lucidasans-12 -b&h-lucida-medium-r-normal-sans-17-120-100-100-p-96-iso8859-1
lucidasans-14 -b&h-lucida-medium-r-normal-sans-20-140-100-100-p-114-iso8859-1
lucidasans-18 -b&h-lucida-medium-r-normal-sans-25-180-100-100-p-142-iso8859-1
lucidasans-24 -b&h-lucida-medium-r-normal-sans-34-240-100-100-p-191-iso8859-1
fixed -misc-fixed-medium-r-semicondensed--13-120-100-100-c-60-iso8859-1
variable -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-*-*
5x8 -misc-fixed-medium-r-normal--8-80-100-100-50-iso8859-1
6x9 -misc-fixed-medium-r-normal--9-90-100-100-c-50-iso8859-1
6x10 -misc-fixed-medium-r-normal--10-100-100-100-c-50-iso8859-1
6x13bold -misc-fixed-bold-r-semicondensed--13-120-100-100-c-50-iso8859-1
As illustrated in the example file, you can specify a variety of font names, including names that were used with Releases 1 and 2 of the X11 server (the last six entries).
NCD Font Management Utilities
The following font utilities are installed by ncdinstall in /usr/bin/X11:
HMX series and Explora series terminals have the following built-in fonts:
10x20.snf
6x10.snf
6x13.snf
8x13.snf
9x15.snf
cursor.snf
helvB10.snf
helvB12.snf
term14.snf