Common Desktop Environment: Programmer's Overview

Standard Font Names

The standard font names defined by the Common Desktop Environment are guaranteed to be available on all Common Desktop Environment-compliant systems. These names do not specify actual fonts. Instead, they are aliases that each system vendor maps to the vendor's 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 Common Desktop Environment-compliant system. These comprise a set of X Window System font names you can use for the most common categories of type designs and styles.

The standard font names are mapped to different fonts on different Common Desktop Environment platforms, typically using the X font alias mechanism. This eliminates the problem of having to select from a varying set of fonts on different platforms. It also enables you to make use of the default set of fonts on a particular vendor's Common Desktop Environment implementation.

The Common Desktop Environment defines two types of standard fonts: application fonts and interface fonts. Use the application fonts for output produced by your application. Motif widgets and the desktop use interface fonts; do not change their default fonts.

Application Fonts

At least six point sizes are available on all Common Desktop Environment platforms for each font associated with a Standard Font Name: 8, 10, 12, 14, 18, and 24. XLFD font descriptions for Common Desktop Environment fonts look like:

-dt-application-*

when used where such patterns are valid.

Two of the most common design variations in fonts used to display text are the presence or absence of serifs and the choice between proportional or regularly spaced (monospaced) characters. Combining these two design variations yields four generic font designs:

Common examples of each of these four designs (in corresponding order) are:

Each of these designs for text fonts typically come in four styles (combinations of weight and slant):

The four styles of each of the four design variations yield 16 generic font variations. These 16 generic fonts are among the most commonly used in general desktop computing. For example, Times Roman, Helvetica, and Courier, each in the four style variations, along with the Symbol font, constitute the Adobe\256 13--the minimum set of fonts built into all PostScript printers.

Your application might not require an exact font family or name, but will need to use, for example, a monospaced font, a sans serif font, or a serif font. You do not have to know the exact font names present on a particular Common Desktop Environment platform. The Common Desktop Environment standard fonts default to the vendor's selection of the best font of a particular design on the vendor's platform.

Specify the XLFD font names for the standard application fonts your application needs as font resource values in the application's app-defaults file. If you do not use these font names, you might need to supply a different app-defaults file for each application on each Common Desktop Environment platform.

Interface Fonts

Interface fonts are the small set of finely optimized fonts that define the look of the desktop on a particular platform. These fonts cleanly and quickly convey small amounts of information, such as that appearing in window titles, buttons, menus, and text fields.

The desktop and the Motif toolkit widgets use interface fonts. Do not use these fonts directly within your application windows.

The standard interface font names are different from the standard application font names. They, like the application font names, are mapped to different fonts on different Common Desktop Environment platforms. Interface fonts come in three styles:

Each style comes in seven sizes. Using the Style Manager, users can choose the size of interface fonts they want on their desktop.

Demo Programs

The drawing program demo in /usr/dt/examples/template does not specify any of its own interface fonts. It serves as an example of how the Common Desktop Environment Motif interface fonts appear. However, this demo does not take advantage of application fonts.

Related Documentation

For more information on standard fonts, see the relevant man pages--particularly DtStdAppFontNames(5) and DtStdInterfaceFontNames(5) for the list of XLFD font names--and the Solaris Common Desktop Environment: Programmer's Guide.