Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
GpiQueryFontMetrics (1.2)
◄Function Group► ◄Overview► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_GPILCIDS
BOOL GpiQueryFontMetrics(hps, cbMetrics, pfm)
HPS hps; /* presentation-space handle */
LONG cbMetrics; /* length of the structure */
PFONTMETRICS pfm; /* address of structure for font metrics */
The GpiQueryFontMetrics function retrieves the font metrics for the
currently selected logical font. The font metrics describe the typeface
family, name, maximum height, average width, and other information about the
font. All sizes the function retrieves are in world coordinates.
Parameter Description
────────────────────────────────────────────────────────────────────────────
hps Identifies the presentation space.
cbMetrics Specifies the length of the font metrics.
pfm Points to a FONTMETRICS structure that receives font metrics for
the logical font.
Return Value
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
Errors
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
PMERR_INV_HPS
PMERR_INV_LENGTH
PMERR_INV_LENGTH_OR_COUNT
PMERR_PS_BUSY
Example
This example uses the GpiQueryFontMetrics function to retrieve the font
metrics for the current font.
FONTMETRICS fm;
GpiQueryFontMetrics(hps, sizeof(FONTMETRICS), &fm);
See Also
GpiQueryCp, GpiQueryFonts, GpiQueryKerningPairs, WinGetLastError,
FONTMETRICS
♦