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

Administering Fonts

Using the Style Manager Font dialog box, you can select the font group and size you want for all applications. You can also specify fonts on the command line or use resources to:

A font is a type style in which text characters are printed or displayed. The desktop includes a variety of fonts in different styles and sizes.

A bitmap font is made from a matrix of dots. (By default, Style Manager configures bitmap fonts only.) The font is completely contained in one file. Many files are needed to have a complete range of sizes, slants, and weights.

Fonts are specified as values of resources and as parameters to commands. The X Logical Font Description (XLFD) name is the method by which a desired font is requested. The system finds the font that best matches the description it was given.

Setting Desktop Font Resources

The Style Manager Font dialog box enables you to select fonts (up to seven sizes) for things such as text entry and labels. It also enables you to add or delete font groups.

Resources Set by the Font Dialog Box

When a font is selected, the following resources are written to the RESOURCE_MANAGER property:

Resources Used by the Font Dialog Box

The fonts used for each selection in the Font dialog box are specified in the /usr/dt/app-defaults/Dtstyle resource file. Up to seven sizes can be specified.

NumFonts—number of font sizes in the Font dialog box

SystemFont[1-7]—up to seven resources assigning a specific font to a Font dialog box selection for SystemFont

UserFont[1-7]—up to seven resources assigning a specific font to a Font dialog box selection for UserFont


Note –

The default fonts for these resources have been chosen for readability on various displays. If you want a specific font for an application, set the font with an application font resource rather than changing these desktop fonts.


For more information about application fonts, see the DtStdAppFontNames(5) and DtStdInterfaceFontNames(5) man pages.

To List Available Fonts

  1. Type the following:

    xlsfonts [-options] [-fn pattern]

    A list of XLFD names and font alias names available on your system is displayed. Bitmap fonts show values in all fourteen XLFD fields. Scalable typefaces show zeros in the PixelSize, PointSize, ResolutionX, and ResolutionY positions.

  2. To check for specific fonts, use the pattern-matching capability of xlsfonts. Use wildcards to replace the part of the pattern you are not trying to match.

  3. If xlsfonts does not show any font names starting with dt, your font path does not include the desktop fonts. Type the following command to include the desktop fonts into your available fonts:

    xset +fp directory name
    

    where directory name is the directory containing the desktop fonts. The default location set by session startup is /usr/dt/config/xfonts/language.

    For additional information:

    • The xset and xlsfonts man pages list the available options.

    • Using the X Window System explains font alias names and the xset client.

To Specify Fonts on the Command Line

    Use the -xrm command-line option to specify a font resource for a specific client. For example:

application name -xrm \
"*bitstream-charter-medium-r-normal-8-88-75-75-p-45-iso8859-1"

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:

User's Font Group Filesystem Storage

When a user adds a font group, it is stored in the following location:

HomeDirectory/.dt/sdtfonts/host/locale/typeface-nnnnnn

host is the local workstation's host name.

locale is the user's current locale such as “C” or “ja.”

typeface-nnnnnn is a name derived from the selected font and a unique generated number.

This font group directory contains the following three files

The fonts.alias and fonts.dir files are the normal X11 font files suitable for adding to the Xserver's font path. The sdtfonts.group file contains the user specified font group name.

System Administrator Font Group Creation

So that other users can access the font groups on a workstation, the system administrator can copy font groups to the /etc/dt/sdtfonts/locale directory or to the /usr/openwin/lib/X11/stdfonts/locale directory. Session Manager first looks in HomeDirectory/.dt/stdfonts/host/locale, next in /etc/dt/sdtfonts/locale, and last in /usr/openwin/lib/X11/stdfonts/locale.