Closest-Matching Font Selection

The alternative to selecting a specific font is to set the match value to 0. To have the Presentation Manager programming interface select the closest-matching font available, do the following:

Outline fonts are affected by the current character attributes (for example, character box, shear, and angle). Because an outline font might be made available to you, even when you requested an image font, call GpiQueryFontMetrics to determine whether the font is an image font or an outline font. GpiQueryFontMetrics returns the metrics of the current logical font in world coordinates.

The setting of the definition indicators in the FONTMETRICS structure tell you whether the font is either an image or outline font, or a device or generic font. If the font is an outline font, specify values for the character attributes before using the font. Outline fonts are unaffected by the maximum baseline extent and average character width values specified in GpiCreateLogFont.

If the default font provided is an image font, and you also have specified FATTR_FONTUSE_TRANSFORMABLE, any attempt to draw graphics characters in CM_MODE3 raises an error condition. This is an exception to the general rule that a FATTR_FONTUSE_TRANSFORMABLE font must be used in CM_MODE3 only.


[Back: Font Resolution]
[Next: Selecting the New Current Font]