[Top] [Prev] [Next] [Contents] [Index]

Font Server Issues

This section describes font server usage:

The NCD font server is host-based software that provides fonts to X servers. The font server provides access to more fonts than the X server and decreases the time it takes the X server to display fonts.

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

When an application requests a font, the X server examines its font path to determine where it should look for the font. When the font server is included in the X server's font path, the X server sends the request to the font server. If the font needs scaling, the font server applies the appropriate scaling algorithm and sends the scaled bitmap to the X server.

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:

Bitstream Speedo outline and IBM Type 1 (Adobe) outline formats describe fonts as mathematical algorithms rather than as individual pixels. Consequently, they can be resized by applying the same algorithm on a different scale. The resulting font display is smooth, regardless of point size or resolution.

Outline fonts are in the /usr/lib/X11/ncd/fonts/Speedo and /usr/lib/X11/ncd/fonts/Type1 directories.

Although the ability to use various SNF formats is part of the NCD font server, using SNF font formats from HP, IBM, SCO, and DEC is not part of the X Consortium's Sample Implementation.

The font server can read either compressed or uncompressed font files.

Font Server Configuration Issues

The basic procedures for configuring and starting the font server are described in the NCDware System Administrator's Guide.

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

Two font server configuration parameters control the load on each font server and specify how the font server responds to occurrences of imminent overloading. The client-limit parameter specifies how many clients can access the font server concurrently before it refuses access. The clone-self parameter specifies whether the font server can clone itself, thereby spreading the load over more than one process, when it reaches the limit specified in client-limit.

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

To assist in troubleshooting, you can specify a method for logging errors using two font server configuration parameters. The error-method parameter specifies a method of error logging. The permitted methods are:

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

Font server configuration data is stored in a font server configuration file called config in the directory /usr/lib/X11/ncd/fs. All of the parameters that make up the font server configuration file are described in the NCDware System Administrator's Guide for UNIX Systems.

The following sample font server configuration file includes values for every font server parameter. The NCDware distribution also contains a sample 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

Configuring Font Server Timeouts

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
Possible Values
Result
default 30
30 The terminal tries to connect to a font server for 30 seconds before failing.
integer How long (in seconds) that the terminal tries to connect to a font server before failing. Range: 0 - 100.

Table 7-13 xserver-fontserver-reopen-timeout Parameter
Possible Values
Result
default 10
10 After a font server fails, the terminal tries for 10 seconds to reopen it before timing out.
integer How long (seconds) the terminal attempts to reopen a font server after a failure before timing out. Range: 0 - 100.

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
Possible Values
Result
default 20
20 The terminal waits 20 seconds to obtain a font from a font server before failing.
integer How long (in seconds) the terminal waits to obtain a font from a font server before failing. Range: 0 - 100.

Table 7-15 xserver-fontserver-retry-attempts Parameter
Possible Values
Result
default 5
5 The terminal makes five attempts to obtain a font from a font server before giving up.
integer How many attempts the terminal makes to obtain a font from a font server before giving up. Range: 0 - 25.

Getting Information about the Font Server

The ncdfsinfo font server information utility displays information about the font server, including the name of the host and the font server version number, the maximum request size in longwords and bytes, the number and names of catalogues, the number and names of alternate servers, and the number of extensions.

The ncdfsinfo utility syntax is:


ncdfsinfo [-server font-server ]

If you use the -server flag, use the syntax tcp/host:port for font-server, where host is the network name or IP address of the host on which the font server resides and port is the TCP port on which the font server listens for connections.

You must set the FONTSERVER environment variable to specify the default font server in use for the ncdfsinfo utility. Use the syntax described in the preceding paragraph for the font-server variable to define the FONTSERVER variable.

For more information about ncdfsinfo, see the ncdfsinfo man page.

Getting Information about Fonts from the Font Server

The ncdfslsfonts font information utility lists the fonts available on the font server. You can request a subset of the available fonts by defining a pattern for the utility to match. Additional options specify the name of the font server you wish to query, the level of detail you want in the listing, and the format of the output.

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 ncdshowfont utility reports information about a font and displays a representation of each character in the font. When specifying a font, you can use the asterisk (*) and question mark (?) as wildcard characters. The asterisk matches any sequence of characters; the question mark matches any single character. The wildcard characters must be enclosed in double quote marks.

The syntax for ncdshowfont is:


ncdshowfont [-options] [-fn font]

where options are any of the options listed in the ncdshowfont man page, and font is the XLFD name of the font you want to examine.

The ncdfstobdf utility reads a font from a font server and displays the contents of the font file in BDF format. This allows you to recreate a font and is useful when testing servers, debugging font metrics, and reproducing lost BDF fonts.

The syntax for ncdfstobdf is:


ncdfstobdf -fn font [-server font_server]

where font is the XLFD name of the font you want to display, and font_server is the host on which the font server resides and the TCP port on which the font server listens for connections. Specify font_server as tcp/host:port.



[Top] [Prev] [Next] [Contents] [Index]

Send comments, suggestions, or questions about this document to the NCD Technical Publications Department by Internet e-mail. Write to us at techpubs@ncd.com.
Copyright © 1997, NCD Inc. All rights reserved.