HP OpenVMS Systems Documentation |
Common Desktop Environment: Programmer's Guide 2 Integrating FontsContents of Chapter: 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 FontsDefault Font NamesThe set of standard interface font names is defined by the XLFD field name values described in Table 2-1.
Table 2-1 Field Name Values for Standard Interface Font Names
The seven nominal sizes are as follows:
For example, in Western locales, the full set of 21 CDE Standard Interface Font Names can be represented:
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
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 CDE Internationalization Programmer's Guide Standard Application FontsDefault Font NamesThe 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
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 Using these values, the XLFD pattern
matches the full set of CDE standard application font names on a given platform. The pattern
matches the bold, proportionally spaced CDE fonts, both serif and sans serif. And the pattern
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:
Point Sizes for Standard Application FontsThe complete set of point sizes available for each of the standard application font names is determined by the set of fonts shipped with a vendor's CDE platform, whether bitmapped only or both bitmapped and scalable outline. The minimum set of sizes required and available on all CDE platforms corresponds to the standard sizes of bitmapped fonts that make up the default mapping for X11R5: 8, 10, 12, 14, 18, and 24.For example, the entire set of six sizes of the plain monospaced font can be represented by the patterns:
These patterns match the corresponding standard font name on any CDE platform, even though the numeric fields other than POINTSIZE may be different on various platforms, and the matched fonts may be either serif or sans serif, depending on how the vendor implemented the set of standard names. Standard Application Font Names in app-defaults filesYou can code a singleapp-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:
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:
to:
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.
|