The X server depends on downloading fonts from hosts to satisfy most client font requests.
The X server locates fonts by searching the directories in its font path or handing off requests to font servers in its font path.The default font path directs the terminal to search the font directories supplied with the NCDware distribution.
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.
In the X Window System, fonts are named using the XLFD (X Logical Font Description) conventions. XLFD names supply information about the developer of the font, the font family, and various characteristics of the font, including size, weight, and dots per inch.
An XLFD name consists of 14 fields separated by hyphens. The fields in the following example font name are described in Table 7-1:
||Developer of the font, also called the foundry.|
||The font family, such as Courier, Helvetica, or Times.|
||Weight, usually bold or medium.|
||Slant (i for italic, o or oblique, r for roman, ri for reverse italic, and ot for other).|
||Width of the characters: condensed, semi-condensed, narrow, normal, or double-wide.|
|Style||(not used)||Additional information to identify a font: i for informal, r for roman, serif for serif, and sans for sans serif. This field is rarely used; two hyphens are used as a place holder.|
||Height of the characters in pixels; a zero in this field means the font is a scalable font.|
||Height of the font in tenths of a point (decipoints); a zero in this field means the font is scalable.|
||Horizontal resolution in dpi (dots per inch); a zero in this field indicates a scalable font.|
||Vertical resolution in dpi (dots per inch); a zero in this field indicates a scalable font.|
||Convention for placing characters next to each other, such as m for monospaced, p for proportional, and c for character-cell monospaced.|
||Average width in tenths of a pixel; a zero in this field indicates a scalable font.|
||The organization or standard registering the character set, usually ISO 8859.|
|Charset encoding||1||The actual character set. iso8859-1 is ISO Latin-1, an ASCII character set that includes special European characters.|
Wildcards in Font Names
Any field in a font specification can be replaced by a wildcard, which is a special character that allows any font to match the property represented by a wildcard:
For example, the font name:
matches these fonts:
When searching for a font, the X server uses the first font it finds that meets all the criteria specified in the font name. If you use wildcards instead of specifying all properties, the X server uses the first font that matches the properties you specify.
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
Bitmap font names differ from outline (scalable) font names in the amount of information specified. A bitmap font name has data in all fields. An outline font name has 0s (zeros) in all of the size fields: the size of the characters in pixels, the size in tenths of points, horizontal resolution, vertical resolution, and average width. Outline font names look similar to the following:
You can specify fonts for a client as X resources or in the client's command line, with the -fn option. When specifying a font you must use the XLFD font name, with or without wildcards. The following examples show font specifications in a resource setting and in a command line:
%xterm -fn -adobe-courier-bold-r-normal--20-140-100-100-m-110-iso8859-1
If you are using a font name with asterisks in a command line, the font name must be surrounded by single quotes to prevent the UNIX shell from interpreting the asterisks. For example:
% xterm -fn '-*-courier-bold-r-normal--20-140-*-*-*-*-*-*'
For outline fonts, you must provide a well-formed font name in the font specification. A well-formed font name contains all 14 hyphens specified in the XLFD convention. Wildcards are permitted for any field. For example, this is not a well-formed name because it does not contain all 14 hyphens:
This is a well-formed name:
The NCDware distribution includes the full set of fonts in the MIT X Window System distribution plus several outline fonts. If you installed fonts when you ran ncdinstall, you should have some or all of the following fonts installed:
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
Fonts can be accessed from the network by using the file service and network protocols or by using one more font servers. If you are accessing fonts through the file service, you can use the following network protocols:
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
Font files require a lot of disk space, so make sure you install only the fonts you need. Fonts in the NCDware distribution may be duplicates of fonts already installed on network hosts.
Fonts can be installed on any computer on the network, and the fonts used by a given terminal can be distributed on several hosts.
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
When a client requests a font that the X server cannot find, an error response is sent to the client. Usually, clients continue to run, using the X server's default font. Occasionally, a client crashes when requested fonts are not available.
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
A terminal's font path is made up of two types of elements: font directories and font servers. An NCD terminal attempts to access only fonts represented by elements in its font path. The X server searches the font directories (and font servers) in the order in which they are listed in the font path and uses the first match it finds.
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.
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
PCF (Portable Compiled Font)
The standard format for X11R5 and the format of fonts in the NCDware distribution. PCF files may be shared among machines with different architectures.
SNF (Server Normal Font)
A server-dependent format. NCD X servers can still read the SNF fonts supplied on previous NCDware distributions.
DWF (DECWindows Format)
NCD terminals can read these fonts from VMS hosts.
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.
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
Fonts for 100-dpi terminals
Fonts for 85-dpi and 75-dpi terminals
Fonts from AT&T for OPEN LOOK clients
Fonts for DECwindows applications on 100-dpi terminals
Fonts for DECwindows applications on 85-dpi and 75-dpi terminals
Fonts for Java
Fonts for PEX 1
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
Each font directory contains a font directory management file called fonts.dir, which contains an entry for each font file in the directory. A fonts.dir file is required in every font directory for the X server to access any fonts in the directory. When searching for a font, the X server reads the fonts.dir files in the directories in the terminal's font path to find out where fonts are located. An example fonts.dir file follows.
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
Applications sometimes request unavailable fonts. As a result, the application might use undesirable default fonts, crash, refuse to run, or run poorly. To avoid such problems, you can instruct the server to substitute a different font for the one requested by creating an entry in the font alias management file, called fonts.alias, in the font directory where the substitute font resides.
Entries in the font alias management file consist of the name used by the application in the font request and the XLFD description of the substitute font. A portion of an example fonts.alias file follows.
The first font specification on a line is the unavailable font, and the second is the substitute font. When both font names are too long for one line, the line automatically wraps to the next line.
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:
If the terminal is licensed for PEX, the roman.phont and roman_m.phont built-in fonts are also available.