┌──────────────────────────────────────────────────────────────────────┐ │Do not assume typeface name of a font. │ └──────────────────────────────────────────────────────────────────────┘
Many popular fonts (e.g. Courier, Helvetica) for SBCS environment do not contain DBCS characters. Since fonts' resource for DBCS are huge, a user does not always install of fonts. Moreover, font names are different among DBCS countries or font vendors, and subject to change. Thus, it would decrease the portability of an application if any typeface name is hard-coded in the source program.
When applying a font, the application should check whether or not a font contains DBCS characters if the environment is for DBCS. To find fonts containing DBCS, check if the FM_TYPE_MBCS flag is set in the fsType of FONTMERICS.
┌──────────────────────────────────────────────────────────────────────┐ │As for the raster font, use the system default font and provide an │ │interface to change the font. │ └──────────────────────────────────────────────────────────────────────┘
The GPI manuals say the GpiQueryLogicalFonts API specifying 0 to the lcid argument can be used to query the default font. This method returns SBCS font, Courier, even if the environment is for DBCS. Unless there is special requirements (e.g. an editor may want to use the fixed pitch font), do not set a special font in the program at first (that is, use the system default font), and provide a user interface to select a preferable font.
┌──────────────────────────────────────────────────────────────────────┐ │As for the outline font, an application must be sensitive in case │ │setting a font has failed. │ └──────────────────────────────────────────────────────────────────────┘
When an application fails to set an outline font, the system uses the default outline font which is, in general, Courier. In such cases, check the MBCS capability in the same way described above.
An application may have necessity to set an outline font to a window before showing it. In such case, the rule is the same with raster fonts. Do not hard-code any font name. If it is necessary to determine the initial font name explicitly, store the information to the external, customizable data area (e.g. .INI file). The dependency to a specific font must be clearly documented.
┌──────────────────────────────────────────────────────────────────────┐ │The font dialog control provided by PM supports DBCS fonts as well as │ │SBCS fonts. │ └──────────────────────────────────────────────────────────────────────┘
The font dialog control, which is a standard user interface to show and let end users select the desired font, displays all available fonts on the run time environment regardless of SBCS or DBCS font.