This section describes font server usage:
The font server was designed at NCD for the X Consortium to simplify font management and to support use of scalable outline fonts. The NCD font server adds functionality to the X Consortium's Sample Implementation and includes enhancements for X11R6.
How the Font Server Accesses Fonts
Using a font server allows the X server to perform other operations while the font server locates, parses, and scales fonts, and then returns the requested bitmaps to the X server. When the X server receives the requested font, it loads the font into its internal database, making the font available to the client. To the X server, the font server is simply an element in its font path. (See Figure 7-1.)
The font server can be configured to forward requests that it cannot fulfill to an alternate font server. Such daisy-chained font servers are useful for load sharing and to widen the range of font sources. The font server includes a security feature for limiting the X servers permitted to access fonts.
Usable Font Formats with a Font Server
With a font server, NCD terminals can use the following fonts:
Outline fonts are in the /usr/lib/X11/ncd/fonts/Speedo and /usr/lib/X11/ncd/fonts/Type1 directories.
The font server can read either compressed or uncompressed font files.
Font Server Configuration Issues
This section provides more information about some of the font server configuration parameters and includes a sample font server configuration file.
Network Considerations
By distributing NCD font servers on different hosts on the network, system administrators can ensure reliable access to fonts and decrease dependence on any single host. In the font server configuration file, the alternate-servers parameter specifies alternate font servers to be tried if the connection to the current font server is lost.
Host Considerations
The following aspects of configuration on the host are addressed in the font server configuration file.
Font Access
The font server must be installed on each host from which fonts are to be accessed and the fonts must be in a format that the font server can read (see "Usable Font Formats with a Font Server").
For the font server to access the fonts, the font directories must be listed in the font server configuration file under the catalogue parameter. The font server accesses the font directories in the order in which they are listed in this parameter.
Host Load
The font server uses a cache to store recently requested fonts. Use of a cache decreases the time needed to access and display fonts. Fonts held in cache are available immediately for use; they do not have to be read from a file or rescaled. The size of the cache used depends on the memory available on the host and is specified (in bytes) using the font server configuration parameter cache-size.
Client Connection
On TCP/IP networks, the system administrator or system manager also specifies the TCP port number on which the font server listens for client (X server and host) connections. The font server parameter port specifies the port number.
Security
Client access to the font server can be controlled by using a font server parameter called trusted-clients. By default, the font server allows any client (X server or host) to connect to it and access fonts. Listing names of clients under the font server trusted-clients parameter limits font server access to only those clients.
Default Font Specifications
Two font server configuration parameters set defaults for cases in which the point size or resolution (dpi) are not specified. A default point size is set in tenths of a point (sometimes called decipoints) in the default-point-size parameter. Supported default resolutions are listed under the default-resolutions parameter.
Error Logging
The error-file parameter specifies a name of a file for logging error messages when the error handling method (specified using error-method) is set to "file."
Example NCD Font Server Configuration File
# Sample Font Server Configuration File/UNIX Hosts
# The size in bytes of the font server cache.
cache-size = 2000000
# Directories searched for fonts. The first is an SNF font. The second is a
# set of Speedo outlines, the third is a set of misc bitmaps and the last is a
# set of 100dpi bitmaps.
catalogue = ibm:/usr/lib/X11/ncd/fonts/aix/100dpi,
/usr/lib/fonts/speedo,
/usr/lib/X11/ncd/fonts/misc,
/usr/lib/X11/ncd/fonts/100dpi/
# Names of alternate font servers for clients to use.
alternate-servers = tcp/green:7001,tcp/green:7002
# Allow a maximum of 10 clients to connect to this font server.
client-limit = 10
# When this font server reaches its client limit, start up a new one.
clone-self = on
# The default point size to be used when a font name does not specify point
# size. The unit of measurement is decipoints.
default-point-size = 120
# The default resolutions to be used when a font name does not specify
# resolution. The resolutions specified are 100 x 100 and 75 x 75
default-resolutions = 100,100,75, 75
# The file to be used for logging errors when "file" is specified.
error-file = /var/log/fs
# The method of error logging to be used. Possible values are none, file,
# syslog, opcom, and off.
error-method = file
# The port number on which the font server listens for connections.
port = 7001
# The font server should not scale bitmaps.
scaled-bitmaps = false
# The SNF format is read as NCD SNF (msb, msb, 4, 4).
snf-format = msb,msb,4,4
# The clients from which the font server accepts connections.
trusted-clients = green, expo.lcs.mit.edu, focus16
The parameters xserver-fontserver-open-timeout and xserver-fontserver-reopen-timeout control how long the terminal tries to contact a font server (Setup -> Change Setup Parameters -> Fonts [Font Server section] -> Open Timeout, Reopen Timeout).
Table 7-12 xserver-fontserver-open-timeout Parameter
Table 7-13 xserver-fontserver-reopen-timeout Parameter
The xserver-fontserver-read-timeout and xserver-fontserver-retry-attempts parameters control how long the font server tries to obtain fonts (Setup -> Change Setup Parameters -> Fonts [Font Server section] -> Read Timeout, Reconnect attempts before failure).
Table 7-14 xserver-fontserver-read-timeout Parameter
Table 7-15 xserver-fontserver-retry-attempts Parameter
Getting Information about the Font Server
The ncdfsinfo utility syntax is:
ncdfsinfo [-server
font-server ]
For more information about ncdfsinfo, see the ncdfsinfo man page.
Getting Information about Fonts from the Font Server
The syntax of the ncdfslsfonts utility is:
ncdfslsfonts [-options . . .] [-fn
pattern
]
In specifying a subset of fonts, you can use the * wildcard character to match any sequence of characters (or none) and ? to match a single occurrence of any character. You must put quotation marks around the wildcard characters to prevent them from being expanded by the shell. For detailed information about ncdfslsfonts, see the ncdfslsfonts man page.
Displaying Font Server Fonts
Two NCD utilities provide ways to examine font server fonts.
The syntax for ncdshowfont is:
ncdshowfont [-options] [-fn font]
ncdfstobdf -fn font [-server font_server]