GetOutlineTextMetrics

3.1

  WORD GetOutlineTextMetrics(hdc, cbData, lpotm)    
  HDC hdc; /* handle of device context */
  UINT cbData; /* size of buffer for information */
  OUTLINETEXTMETRIC FAR* lpotm; /* address of structure for metrics */

The GetOutlineTextMetrics function retrieves metric information for TrueType fonts.

Parameters

hdc

Identifies the device context.

cbData

Specifies the size, in bytes, of the buffer to which information is returned.

lpotm

Points to an OUTLINETEXTMETRIC structure. If this parameter is NULL, the function returns the size of the buffer required for the retrieved metric information. The OUTLINETEXTMETRIC structure has the following form:

typedef struct tagOUTLINETEXTMETRIC {
    UINT        otmSize;
    TEXTMETRIC  otmTextMetrics;
    BYTE        otmFiller;
    PANOSE      otmPanoseNumber;
    UINT        otmfsSelection;
    UINT        otmfsType;
    UINT        otmsCharSlopeRise;
    UINT        otmsCharSlopeRun;
    UINT        otmItalicAngle;
    UINT        otmEMSquare;
    INT         otmAscent;
    INT         otmDescent;
    UINT        otmLineGap;
    UINT        otmsXHeight;
    UINT        otmsCapEmHeight;
    RECT        otmrcFontBox;
    INT         otmMacAscent;
    INT         otmMacDescent;
    UINT        otmMacLineGap;
    UINT        otmusMinimumPPEM;
    POINT       otmptSubscriptSize;
    POINT       otmptSubscriptOffset;
    POINT       otmptSuperscriptSize;
    POINT       otmptSuperscriptOffset;
    UINT        otmsStrikeoutSize;
    INT         otmsStrikeoutPosition;
    INT         otmsUnderscorePosition;
    UINT        otmsUnderscoreSize;
    PSTR        otmpFamilyName;
    PSTR        otmpFaceName;
    PSTR        otmpStyleName;
    PSTR        otmpFullName;
} OUTLINETEXTMETRIC;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

The OUTLINETEXTMETRIC structure contains most of the font metric information provided with the TrueType format, including a TEXTMETRIC structure. The last four members of the OUTLINETEXTMETRIC structure are pointers to strings. Applications should allocate space for these strings in addition to the space required for the other members. Because there is no system-imposed limit to the size of the strings, the simplest method for allocating memory is to retrieve the required size by specifying NULL for the lpotm parameter in the first call to the GetOutlineTextMetrics function.

See Also

GetTextMetrics