Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

X Logical Font Description (XLFD)

A font is specified by listing fourteen different characteristics, separated by dashes (-). This is called the X Logical Font Description (XLFD). In some cases, a property in the list can be replaced by a * wildcard, and a character within a property can be replaced by a ? wildcard. Table 17–4 lists font property string specifications.

The form of the property string specification is:

"-Foundry-FamilyName-WeightName- Slant-SetwidthName-AddStyleName-PixelSize- PointSize-ResolutionX-ResolutionY-Spacing- AverageWidth-CharSetRegistry-CharSetCoding"

Table 17–4 Font Property String Specification

Property String 

Definition 

Foundry

A string identifying the font designer 

FamilyName

A string identifying the trademarked name of the font 

WeightName

A string giving the relative weight of the font, such as bold 

Slant

A code describing the direction of slant: 

R (Roman–no slant) 

I (Italic–slant right) 

O (Oblique–slant right) 

RI (Reverse Italic–slant left) 

RO (Reverse Oblique–slant left) 

SetwidthName

A string describing the width, such as compressed or expanded 

AddStyleName

A string providing any additional information needed to uniquely identify the font 

PixelSize

An integer giving the size of an em-square in pixels 

PointSize

An integer giving the size of an em-square in decipoints 

ResolutionX

An integer giving the horizontal resolution in pixels 

ResolutionY

An integer giving the vertical resolution in pixels 

Spacing

A code specifying the spacing between units: 

M (Monospace--fixed pitch) 

P (Proportional space--variable pitch) 

C (Character cell) 

AverageWidth

An integer giving the average width in 1/10th pixels 

CharSetRegistry

A string identifying the registration authority that has registered the font encoding 

CharSetEncoding

A string identifying the character set in the specified registry 

Example

The following XLFD name describes a font named charter made by Bitstream that supports the ISO8859-1 standard encoding:

-bitstream-charter-medium-r-normal--8-80-75-75-p-45-iso8859-1

It is medium weight, with no special slanting, and normal width. The font is proportional, with an em-square box of 8 pixels or 8.0 points. The horizontal and vertical resolution are both 75 pixels. The average width of a character is 45 1/10ths pixels or 4.5 pixels.

Parts of this string can be replaced by wildcards. The system uses the first font it finds that matches the parts you have specified.

If all you want is an eight-pixel charter font, you could use:

*-charter-*-*-*-*-8-* 

Viewing Selected Font Group Attributes

By selecting the Attributes button from the Style Manager Font dialog box, you can view the following font group attributes: