## Presentation Device Driver Reference for OS/2

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

### GreCreateLogicalFont - Parameters

hdc (HDC) - input Device context handle.

lcid (LONG) - input Local identifier that is to be assigned to the font.

pchName (PSTR8) - input Pointer.

Pointer to an eight-character name used to describe the logical font.

pAttrs (PFATTRS) - input Pointer.

Pointer to a FATTRS structure containing the font attributes:

usRecordLength Length in bytes of this structure

fsSelection Flags that can be set to define those features to be simulated by the system:

FATTR_SEL_ITALIC Italic characters are required.
FATTR_SEL_UNDERSCORE Underscored characters are required.
FATTR_SEL_STRIKEOUT Strikeout characters are required.
FATTR_SEL_BOLD Bold characters are required.

lMatch The match number for the font. GreQueryFonts returns a unique match number for each font that, together with szFaceName, can be used for font selection. If the match number is negative, a device font is selected. If it is positive, an engine font is selected.

szFaceName The typeface name to which the font is designed. If the szFaceName is provided, an attempt is made to select the font with that face name. If the szFaceName is blank (0 length or NULL), then a default font is used.

idRegistry The Registry number for the font. This should be set to the value returned by GreQueryFonts.

usCodePage Defines the code page supported by the font.

lMaxBaselineExt The required (average) height above the baseline for uppercase characters in world coordinates. For outline and transformable fonts (FATTR_FONTUSE_OUTLINE and FATTR_FONTUSE_TRANSFORM), lMaxBaselineExt should be set to 0.

lAveCharWidth For image fonts, the required average intercharacter increment for the font in world coordinates. For outline and transformable fonts (FATTR_FONTUSE_OUTLINE and FATTR_FONTUSE_TRANSFORM), lAveCharWidth should be set to 0.

fsType Type indicator. Setting fsType to FATTR_TYPE_KERNING indicates that kerning is to be used if the font provides kerning information.

fsFontUse Flags containing information about how the font is to be related to the character attributes:

FATTR_FONTUSE_NOMIX Specifies that permissive mixing is allowed when the font is used. The engine can ignore any interaction with graphics primitives and can use overpaint and leave alone as the foreground and background mixes rather than using the current mix attributes.

FATTR_FONTUSE_OUTLINE Specifies that the font must be an outline font. When the font is not defined by lMatch and FATTR_FONTUSE_OUTLINE is specified, the system searches for an outline font. If the search fails, a default font is selected. When the font is not defined by lMatch and FATTR_FONTUSE_ OUTLINE is not set, the system searches for an image font that matches lMaxBaselineExt and lAveCharWidth. If this fails, it searches for an outline font with the required szFaceName and fsSelection flags.

FATTR_FONTUSE_TRANSFORMABLE Specifies that the font must be transformable ( that is, it can be scaled, rotated, and sheared). Transformable fonts are used only in CM_MODE3. Nontransformable fonts can be used in CM_MODE1 or CM _MODE2 but not in CM_MODE3.

pInstance (PVOID) - input Pointer to instance data.

lFunction (ULONG) - input High-order WORD=flags; low-order WORD= NGreCreateLogicalFont.

rc (LONG) - returns Return Codes.

This function returns a LONG value indicating whether the font has been matched:

FONT_DEFAULT The font was not matched. The default font is to be used.
FONT_MATCH The font has been matched successfully.
GPI_ERROR Error.

Possible Errors Detected: When an error is detected, the graphics engine calls WinSetErrorInfo to post the condition. Reasons for failure of this function include:

PMERR_BASE_ERROR
PMERR_COORDINATE_OVERFLOW
PMERR_DEV_FUNC_NOT_INSTALLED
PMERR_EXCEEDS_MAX_SEG_LENGTH
PMERR_HDC_BUSY
PMERR_INSUFFICIENT_MEMORY
PMERR_INV_CODEPAGE
PMERR_INV_COORD_SPACE
PMERR_INV_EXTENDED_LCID
PMERR_INV_FONT_ATTRS
PMERR_INV_FONTDEF
PMERR_INV_HDC
PMERR_INV_IN_AREA
PMERR_INV_LENGTH_OR_COUNT
PMERR_INV_SETID
PMERR_SETID_IN_USE

Refer to the "Error Explanations" section of the Presentation Manager Programming Reference for further explanation.