Solaris Common Desktop Environment: Programmer's Guide

Standard Application Font Names in app-defaults Files

You can code a single app-defaults file to specify font resources for your application and use it across all CDE platforms. Because the parts of the standard names that are defined are the same across different vendors' platforms, you can specify these values in the resource specification in the app-defaults file. However, you must use wildcards for the other fields (PIXEL_SIZE, RESOLUTION_X, RESOLUTION_Y, and AVERAGE_WIDTH) because they may vary across platforms. For example, to specify some of the default resource needs for an application named appOne, you might use:

appOne*headFont:
-dt-application-bold-r-normal-sans-*-140-*-*-p-*-iso8859-1 

appOne*linkFont:
-dt-application-bold-i-normal-sans-*-100-*-*-p-*-iso8859-1

As another example, suppose that appTwo running on a vendor's platform defines two font resources for headings and hypertext links. appTwo uses a 14 point bold, serif font (Lucidabright bold) and a 12-point bold, italic sans serif font (Lucida bold-italic). You would then change the font definition from:

apptwo *headingFont:
-b&h-lucidabright-bold-r-normal--20-140-100-100-p-127-iso8859-1 

apptwo *linkFont:   
-b&h-lucida-bold-i-normal-sans-17-120-100-100-p-96-iso8859-1

to:

apptwo *headingFont: 
-dt-application-bold-r-normal-serif-*-140-*-*-p-*-iso8859-1

apptwo *linkFont:   
-dt-application-bold-i-normal-sans-*-120-*-*-p-*-iso8859-1

in your app-defaults file. Even though you may not know the names of the fonts on other CDE platforms, these platform-independent patterns specified with the CDE standard application font names match appropriate fonts on each platform.

You encode them exactly as shown, complete with the * wildcards, in your resource definitions. By applying the wildcards to the numeric fields other than point size, you ensure that the resources match CDE fonts on all platforms, even if the exact pixel size or average width of the fonts is slightly different.

See the DtStdAppFontNames(5) man page for more information.