Using the X Window System > Chapter 6 Using FontsUsing the X11R5 Font Server |
|
The Networked font server provides font services to one or more X display servers in a networked environment. It allows a font administrator to distribute fonts to all X servers from a central administration point. The font server also provides increased font capabilities over those built into the HP X display server — unlike the X display server, the font server understands scalable fonts as well as bitmapped fonts. In an environment without a font server, the X server is able to load bitmapped fonts from directories in its font path: In an environment with a font server, the X server can also load fonts from a font server: The font server itself obtains fonts from directories or from other font servers. Unlike the X server, the font server can read scalable fonts as well as bitmapped fonts: The connection between the X server and a font server is over a TCP network connection: the font server can be running on the same machine as is the X server, or on a remote machine that is acting as a font source for multiple X servers. A font server is shipped with Hewlett-Packard's X11R5 distribution. If the system has not been configured to start the font server automatically (refer to “Starting the Font Server at Boot Time”), then the font server can be started automatically with the command:
This starts a font server in its default configuration at its default TCP port of 7000. Any X server started on the same system after the font server is started will automatically gain access to the fonts provided by that font server, including the licensed scalable Intellifont and Type 1 fonts in the /usr/lib/X11/fonts/ifo.st and /usr/lib/X11/fonts/type1.st directories. By default, a font server accepts connections from font clients (such as X servers) at TCP address 7000, and configures itself according to information in the file /etc/X11/fs/config. Both of these defaults can be overridden with command-line options. See the fs(1) man page for more information. Like the X server, a font server has a font path, a list of sources from which it can get fonts. There are three major differences between the font server's font path and the X server's font path:
Like an X server, a font server can have font servers in its path. That is, font servers can be "chained." Font server chaining can be used to implement powerful and flexible networks of font sources. For example, figure 6-4 shows a company-wide font server with department-specific font servers. All users in Department A and Department B add their respective department's font server to their font path. The font administrator on each machine serving fonts then decides how to configure that font server for use by that department. In this case, he adds the company font server to the font path. You can modify this path, as well as other configuration parameters, by editing the configuration file. See the fs(1) man page for information about all of the options in the configuration file. The behavior of the font server at system boot time is determined by system configuration files. Be default, the font server does not automatically start at boot time. You can change this behavior with the mk_fnt_srvr command. If boot-time startup of the font server is enabled, the resulting font server will run at the default font server TCP address of 7000, and use the default configuration file /usr/lib/X11/fs/config. Refer to the mk_fnt_srvr(1M) man page for more details. The standard X interface provides a detailed description of the font by means of the X logical font description (XLFD) name. The XLFD name is a string of characters that describes properties of the font you want. In X11R5, the XLFD standard supports both bitmapped and scalable fonts. In addition, HP has extended the standard to provide more capabilities with scalable fonts — that is, the ability to generate more variations on scalable fonts. These extensions are described in the following sections. The form of the XLFD is 15 fields separated by dashes. These fields are explained later in this section. "FontNameRegistry-Foundry-FamilyName-WeightName-Slant -SetwidthName-AddStyleName-PixelSize-PointSize-ResolutionX -ResolutionY-Spacing-AverageWidth-CharSetRegistry -CharSetCoding" For example,
specifies a courier, bold, oblique bitmapped font created by Adobe. The font is 10 pixels tall, 100 tenths of a point tall on a 75dpi×75dpi display. Characters are monospaced, and are an average of 60 tenths of a pixel wide. Fonts codes are based on the HP Roman8 encoding. What is actually in the XLFD name differs depending on where in the font-request process the string is being used:
This section explains the meaning of the fields in the XLFD name. Examples of the use of these fields are in a later section. The XLFD name is long, so you can assign a shorter nickname, or alias, for the font, which you then use in place of the long string. Aliases are discussed in “The fonts.alias File” later in this chapter. You may use either upper-case or lower-case letters when you specify a characteristic. Reference XLFD names are all lower-case. The text "[extensions]" means that there are optional extensions to the standard XLFD fields that are used to generate additional font variations. Notice that the underscore (_) character is used in some extensions to avoid confusion with the dash (-).
The authority that registered the font. Usually left blank. If there is a value in the field, it is of the form +version, where version is the version of some future XLFD specification. The trademarked commercial name of the font. If the FamilyName contains spaces, do one of the following for a request XLFD name:
The relative weight of the font, such as bold. For scalable typefaces, the user may specify that the font be darker (bolder) or lighter than the normal for that font. The syntax for this optional extension is: [±horiz_value [±vert_value] ]
If only one delta and value are specified, they apply to both directions. Emboldening and lightening are currently supported only for Intellifont scalable typefaces. A code indicating the direction of the slant for the font.
For scalable typefaces, the user can request additional slanting from the normal. The syntax for this optional extension is: ±value
A description of anything else needed to uniquely identify the font, such as serif or cursive. For scalable typefaces, users can specify that the font be mirrored or rotated. The syntax for the optional extension is: [+Mx +My] [ ±angle]
Don't confuse "slant" with "rotation". A character that has been slanted has its base in the normal position and the top pushed to one side. A character that has been rotated has been moved around some central pivot point. An integer describing the height of an EM square in pixels. For scalable typefaces, you can increase or decrease the horizontal size to make a font wider or narrower than normal for that font. The syntax for this optional extension is [+pixelwidth]
For example, 20+10 requests a font 20 pixels high and 10 pixels wide (or, more accurately, a 20-pixel font whose width is half its normal width). The PixelSize and PointSize fields are related through the ResolutionY field in the XLFD name (see below). You should specify a font by using either PixelSize or PointSize, but not both. An error occurs if you specify both and they conflict. An integer giving the EM square size in decipoints. For example 140 is 14 points. For scalable typefaces, you can expand the horizontal size (set size) to make a font wider or narrower than normal for that font. The syntax for this optional extension is: [+setsize]
For example, "140+240" requests a font 14 points high, and 24 points wide (or, more accurately, a 14-point font whose width is that of a 24-point font). If neither PixelSize or PointSize are specified, the assumption is 12-point. If both are specified and they conflict, an error is returned. Use either PixelSize or PointSize, but not both. The horizontal (X) and vertical (Y) resolution of the device that the font was designed for, measured in pixels-per-inch. If the resolution is not specified in a request XLFD name, the X server defaults to the resolution of the display for which the font is requested. A code indicating the spacing between units in the font.
An integer string giving the average, unweighted width of all the glyphs in the font, measured in 1/10th device-dependent pixels. The registration authority that registered the specified CharSetEncoding. The XLFD conventions expect organizations that control characters to register with the X Consortium and be given a unique name to use in this field. The character set from which the characters in the font are drawn. For scalable typefaces, this field can be used to specify subsets of any of the character sets. This is a performance hint that the X or font server uses to determine which characters need to be realized. The syntax for this optional extension is: =value,value...
If an application requests a character not in the subset, then:
You use the XLFD name or alias whenever you need to specify a font. Some locations are:
|