Querying/Creating Fonts

SBCS PM simply considers a code page as a set of pointers into the Universal Glyph List (UGL) since many of the characters required by each SBCS code pages are common. However, this approach is difficult to be implemented for DBCS. There are so many DBCS characters to define in an universal list and the Double-Byte Character Set system is virtually open-ended (allows user-defined characters).

If applications need to choose a combined code page font (because of the user's request and so on), you need to search the array of font metrics, which you got using GpiQueryFonts, for the specific code page in addition to other things that the user may have selected (such as a face name). The code page should be specified in codepage of FATTRS to GpiCreateLogFont.

When creating a logical font, do not hard-code code page ID's or face-names but get them by querying the system (by DosGetCp for the current code page or GpiQueryFonts for available face-names) or you may allow the user to specify or select them.

Note: For a combined code page, size information, such as xAveCharWidth, in the font metrics is for SBCS characters.


[Back: Loading Fonts]
[Next: Proportionally-Spaced Fonts]