Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This structure contains basic information about a physical font.
typedef struct tagTEXTMETRIC { LONG tmHeight ; LONG tmAscent ; LONG tmDescent ; LONG tmInternalLeading ; LONG tmExternalLeading ; LONG tmAveCharWidth ; LONG tmMaxCharWidth ; LONG tmWeight ; LONG tmOverhang ; LONG tmDigitizedAspectX ; LONG tmDigitizedAspectY ; char tmFirstChar ; char tmLastChar ; char tmDefaultChar ; char tmBreakChar ; BYTE tmItalic ; BYTE tmUnderlined ; BYTE tmStruckOut ; BYTE tmPitchAndFamily ; BYTE tmCharSet ; } TEXTMETRIC;
Members
The tmOverhangmember enables the application to determine how much of the character width returned by a GetTextExtentPoint32function call on a single character is the actual character width and how much is the per-string extra width. The actual width is the extent minus the overhang.
The four low-order bits of this member specify information about the pitch and the technology of the font. A constant is defined for each of the four bits.
Value | Description |
---|---|
TMPF_FIXED_PITCH | If this bit is set the font is a variable pitch font. If this bit is clear the font is a fixed pitch font. Note that those meanings are the opposite of what the constant name implies. |
TMPF_VECTOR | If this bit is set, the font is a vector font. |
TMPF_TRUETYPE | If this bit is set, the font is a TrueType font. |
TMPF_DEVICE | If this bit is set, the font is a device font. |
An application should carefully test for qualities encoded in these low-order bits, making no arbitrary assumptions. For example, besides having their own bits set, TrueType and PostScript fonts set the TMPF_VECTOR bit. A monospace bitmap font has all of these low-order bits clear; a proportional bitmap font sets the TMPF_FIXED_PITCH bit. A Postscript printer device font sets the TMPF_DEVICE, TMPF_VECTOR, and TMPF_FIXED_PITCH bits.
The four high-order bits of tmPitchAndFamilydesignate the font's font family. An application can use the value 0xF0 and the bitwise AND operator to mask out the four low-order bits of tmPitchAndFamily, thus obtaining a value that can be directly compared with font family names to find an identical match. For information about font families, see the description of the LOGFONTstructure.
ANSI_CHARSET | DEFAULT_CHARSET |
SYMBOL_CHARSET | SHIFTJIS_CHARSET |
HANGUL_CHARSET | GB2312_CHARSET |
CHINESEBIG5_CHARSET | OEM_CHARSET |
JOHAB_CHARSET | HEBREW_CHARSET |
ARABIC_CHARSET | GREEK_CHARSET |
TURKISH_CHARSET | VIETNAMESE_CHARSET |
THAI_CHARSET | EASTEUROPE_CHARSET |
RUSSIAN_CHARSET | MAC_CHARSET |
BALTIC_CHARSET |
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Wingdi.h |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
GetTextExtentPoint32, GetTextMetrics, LOGFONT