## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Font Matching

When requested by an application, the mapping of a font to a loaded font that is physically available is done by the graphics engine. A physical font can be one that is built into a particular device or a public font loaded from a .FON file when Presentation Manager is initialized. The engine matches fonts by checking the values for szFacename and lMatch (in the font metrics structures) against those passed to it in GreCreateLogicalFont. If no match is found, the engine proceeds as if the match number was passed with a value of 0. When a value of 0 is passed for either szFaceName or lMatch, the engine ignores that parameter and considers it to match anything. If no face name is specified, the engine supplies a default font from the presentation driver (see GreQueryDevResource), or if none is available, maps the requested font to one of its own default fonts.

When a face name is specified and the match number is 0, the engine checks to see if an image font was requested and, if so, searches for a font of the specified dimensions. If this search fails, the engine then attempts to match the font to an outline font with the face name and selection flags requested. When the match number is 0 and the required font is an outline font, the engine searches for an outline font. Should all these searches fail, a default font is used. See GreRealizeFont.