[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 User's Guide

Specifying Font Lists

As was mentioned previously, some of the widgets Motif uses to accept text input from a user do not use renditions. These widgets do not allow a user to change their colors, tabs, or the other miscellaneous properties accessible through renditions. However, these widgets do allow control over the fonts used for text input, although they use a different structure than the render table. These widgets use a structure called a font list, containing a list of fonts or font sets, and tags corresponding to each entry.

Font list specification syntax varies depending on whether you want to specify a font or a font set. Font lists are specified in resource files by using the following syntax:

font_entry [, 

The resource value string consists of one or more font list entries separated by a, (comma). Each font_entry identifies a font or font set and an optional font list element tag. A tag specified for a single font follows the font name and is separated by an = (equal sign). In a font set, the tag is separated by a : (colon). The colon is required whether a tag is specified or not. If the font list element tag is not present, Motif assigns the default tag, FONTLIST_DEFAULT_TAG.

Use the following syntax to specify a single font for a font entry:

font_name [= 

A font entry that specifies a font set is similar, except a; (semicolon) separates multiple font names and the tag is offset with a: (colon). Use the following syntax to specify a font set for a font entry:

font_name [; 
font_name]+: [

A font_name can be an X Logical Font Description (XLFD) string and a tag is any set of characters from ISO646IRV, except the space, comma, colon, equal sign, and semicolon.

When specifying fonts, you can provide a detailed description for a given font, or you can use the * (asterisk) wildcard to indicate fields whose values can be selected by the font-loading routines called by an application. The following resource entry specifies a 12-point Courier font that can be of any weight, slant, or set width.

*fontList:   -Adobe-Courier-*-*-*--12-120-100-100-*-*

The following example specifies a font set for an application running in a Japanese language environment. The font set contains three fonts.

*fontList: -JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\

The default font list element tag is assumed because a tag has not been specified. The font-loading routines will automatically select the character sets required by the locale.

If you encounter unexpected results when specifying a font list resource, see the documentation for the application to determine whether the application places any constraints on how fonts are specified in font lists.

[ Previous | Next | Contents | Glossary | Home | Search ]