Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

Previous Previous     Contents     Index     Next Next
Chapter 2

Integrating Fonts

Your application may be used by someone sitting at an X terminal, or by someone at a remote workstation across a network. In these situations, the fonts available to the user's X display from the X window server might be different from your application's defaults, and some fonts may not be available.

The standard interface font names defined by CDE are guaranteed to be available on all CDE-compliant systems. These names do not specify actual fonts. Instead, they are aliases that each system vendor maps to its best available fonts. If you use only these font names in your application, you can be sure of getting the closest matching font on any CDE-compliant system.

These standard interface font names are guaranteed to be available for all locales, whereas the standard application font names are only guaranteed for ISO Latin locales. See the man pages, DtStdInterfaceFontNames and DtStdAppFontNames for more information.

Standard Interface Fonts

Default Font Names

The set of standard interface font names is defined by the XLFD field name values described in Table 2-2.

Table 2-1 Field Name Values for Standard Interface Font Names

Field

Value

Description

FOUNDRY

dt

CDE name

FAMILY_NAME

interface system or interface user

CDE standard interface font name

WEIGHT_NAME

medium or bold

Weight of the font

SLANT

r

Roman

SET_WIDTH

normal

Normal set width

SPACING

p or m

 

ADD_STYLE

size hint

sans or serif

Proportional or Monospace values from xxs to xxl

Sans for sans serif font or serif for serif

PIXEL_SIZE

Platform dependent

 

POINT_SIZE

Platform dependent

 

RESOLUTION_X

Platform dependent

 

RESOLUTION_Y

Platform dependent

 

AVERAGE_WIDTH

m

p

Monospace for user font

Proportional for system font

NUMERIC FIELD

Platform dependent

 

CHAR_SET_REGISTRY

Locale Dependent

 

ENCODING

Locale Dependent

 

Point Sizes for Standard Interface Fonts

The seven named point sizes for each of the three styles are preappended in the ADD_STYLE_NAME field. The font XLFD patterns matching these names can match a named size, not a numeric size. These named sizes are used because the exact size of an interface font is less important than its nominal size, and implementation differences for the hand-tuned interface fonts do not allow common numeric point sizes to be assured across systems.

The seven nominal sizes are as follows:

xxs

extra extra small

xs

extra small

s

small

m

medium

l

large

xl

extra large

xxl

extra extra large

The goal of these named sizes is to provide enough fonts to display a variety monitor sizes and resolutions that CDE will run on, and the range of user preferences for comfortably reading button labels, window titles and so forth, can be accommodated in the GUI. Both the smallest size, xxs, and the largest size, xxl, are meant to be reasonable sizes for displaying and viewing the CDE desktop on common displays and X terminals; they are not meant to imply either hard-to-read fine print or headline-sized display type.

Patterns for the Standard Interface Font Names

Using these values, the XLFD pattern

-dt-interface*-*

logically matches the full set of XCDE Standard Interface Font Names. (Note that no specific X server behavior is implied).

For example, in Western locales, the full set of 21 CDE Standard Interface Font Names can be represented:

-dt-interface system-medium-r-normal-*-*-*-*-*-*-*-iso8859-1
-dt-interface user-medium-r-normal-*-*-*-*-*-m-*-iso8859-1
-dt-interface user-bold-r-normal-*-*-*-*-*-m-*-iso8859-1

The full set of patterns in the app-defaults files for all seven system font sizes is:

-dt-interface system-medium-r-normal-xxs*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-xs*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-s*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-m*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-l*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-xl*-*-*-*-*-*-*-iso8859-1
-dt-interface system-medium-r-normal-xxl*-*-*-*-*-*-*-iso8859-1

These patterns could be used in a resource file and will match the full CDE Standard Interface Names for the iso Latin-1 locales on all CDE-compliant systems. For more information, see the DtStdInterfaceFontNames(5) man page.

Using Fonts in CDE Configuration Files

CDE specifies a set of generic standard application font names, in several sizes, that can be used by applications running under CDE on all platforms. Each CDE vendor maps the standard set of font names to its available fonts. The mapping of font names to existing fonts may vary from vendor to vendor.

When you use the standard application font names in your app-defaults files, you can use a single app-defaults file across all CDE platforms. If you do not use the standard font names, you must supply a different app-defaults files for each application on each CDE platform.

All CDE systems provide a set of 13 standard application font names, in at least 6 sizes, that represent 12 generic design and style variations (serif and sans serif), as well as a symbol font. These standard names are provided in addition to the names of the fonts that the standard names are mapped to for a particular CDE platform. An additional four standard font names--to allow both serif and sans serif designs in a monospaced font--may also be provided by CDE platform vendors.

These 13 font names are provided in CDE platforms for the locales using the ISO 8859-1 character set. See the Common Desktop Environment: Internationalization Programmer's Guide for information on using standard font names in other locales.

Standard Application Fonts

Default Font Names

The set of standard application default font names is defined by the XLFD field name values described in Table 2-2 .

Table 2-2 Field Name Values for Standard Application Font Names

Field

Value

Description

FOUNDRY

dt

CDE name

FAMILY_NAME

application

CDE standard application font name

WEIGHT_NAME

medium or bold

Weight of the font

SLANT

r

i

Roman

Italic

SET_WIDTH

normal

Normal set width

ADD_STYLE

sans

serif

Sans serif font

Serif font

PIXEL_SIZE

*

Platform dependent

POINT_SIZE

pointsize

Point size of the desired font

RESOLUTION_X

*

Platform dependent

RESOLUTION_Y

*

Platform dependent

AVERAGE_WIDTH

p

m

Proportional

Monospace

NUMERIC FIELD

*

Platform dependent

CHAR_SET_REGISTRY

iso8859-1

Defining standards authority

ENCODING

1

Character set number

The standard names are available using the regular X Windows XLFD font- naming scheme. When properly specified with appropriate wildcards for the platform-dependent fields, a CDE font name is guaranteed to open a valid, corresponding platform-dependent font. The XLFD name returned from a call to the Xlib XListFont function, however, is not guaranteed to be the same on all CDE platforms.

Using these values, the XLFD pattern

-dt-application-*

matches the full set of CDE standard application font names on a given platform. The pattern

-dt-application-bold-*-*-*-*-*-*-*-p-*-*-*-

matches the bold, proportionally spaced CDE fonts, both serif and sans serif. And the pattern

-dt-application-*-*-*-*-*-*-*-*-m-*-*-*-

matches the monospaced fonts (whether serif or sans serif, or both).

The full set of CDE Standard Application Font Names can be represented as follows:

-dt-application-bold-i-normal-serif-*-*-*-*-p-*-iso8859-1
-dt-application-bold-r-normal-serif-*-*-*-*-p-*-iso8859-1
-dt-application-medium-i-normal-serif-*-*-*-*-p-*-iso8859-1
-dt-application-medium-r-normal-serif-*-*-*-*-p-*-iso8859-1
-dt-application-bold-i-normal-sans-*-*-*-*-p-*-iso8859-1
-dt-application-bold-r-normal-sans-*-*-*-*-p-*-iso8859-1
-dt-application-medium-i-normal-sans-*-*-*-*-p-*-iso8859-1
-dt-application-medium-r-normal-sans-*-*-*-*-p-*-iso8859-1
-dt-application-bold-i-normal-*-*-*-*-*-m-*-iso8859-1
-dt-application-bold-r-normal-*-*-*-*-*-m-*-iso8859-1
-dt-application-medium-i-normal-*-*-*-*-*-m-*-iso8859-1
-dt-application-medium-r-normal-*-*-*-*-*-m-*-iso8859-1
-dt-application-medium-r-normal-*-*-*-*-*-p-*-dtsymbol-1

Previous Previous     Contents     Index     Next Next
 

Updated: 2003-09-29, 21:43