DWORD GetGlyphOutline(hdc, uChar, uFormat, lpMetrics, cbBuffer, lpvBuffer, lpMatrix) | |||||
HDC hdc; | /* device-context handle | */ | |||
UINT uChar; | /* character to query | */ | |||
UINT uFormat; | /* format of data to return | */ | |||
LPGLYPHMETRICS lpMetrics; | /* pointer to structure for metrics | */ | |||
DWORD cbBuffer; | /* size of buffer for data | */ | |||
LPVOID lpvBuffer; | /* pointer to buffer for data | */ | |||
LPMAT2 lpMatrix; | /* pointer to MAT2 structure | */ |
The GetGlyphOutline function retrieves the outline curve or bitmap for an outline character in the current font.
hdc
Identifies the device context.
uChar
Specifies the character for which data is returned.
uFormat
Specifies the format in which the function returns the data. It can be one of the following values:
Value | Meaning |
1 | Return the glyph bitmap. See the following “Comments” section for information about memory allocation. |
2 | Return the curve data points in the rasterizer's native format and use the font's design units. When this value is specified, any transformation specified in the lpMatrix parameter is ignored. |
lpMetrics
Points to the GLYPHMETRICS structure describing the placement of the glyph in the character cell.
cbBuffer
Specifies the size of the buffer into which the function copies information about the outline character. If this value is zero, the function returns the required size of the buffer.
lpvBuffer
Points to the buffer into which the function copies information about the outline character. If this value is NULL, the function returns the required size of the buffer.
lpMatrix
Points to a MAT2 structure specifying a transformation matrix for the character.
The return value is the size of the buffer required for the retrieved information if either the cbBuffer or lpvBuffer parameter is zero. Otherwise, it is a positive value if the function is successful, or GDI_ERROR if there is an error.
The glyph outline returned by the GetGlyphOutline function is for a grid-fitted glyph. (A grid-fitted glyph has been modified so that its bitmapped image conforms as closely as possible to the original design of the glyph.) If an application needs an unmodified glyph outline, it should request the glyph outline for a character in a font whose size is equal to the font's EM units. The value for a font's EM units is stored in the otmEMSquare member of the OUTLINETEXTMETRIC structure.
An application can rotate characters retrieved in bitmap format by specifying a 2 by 2 transformation matrix in the lpMatrix parameter.
GetOutlineTextMetrics,