Platform SDK: International Features |
The GetTextCharsetInfo function obtains information about the character set of the font that is currently selected into a specified device context.
int GetTextCharsetInfo( HDC hdc, // handle to DC LPFONTSIGNATURE lpSig, // data buffer DWORD dwFlags // reserved; must be zero );
If a TrueType font is currently selected into the device context, the FONTSIGNATURE structure receives information that identifies the code page and Unicode subranges for which the font provides glyphs.
If a font other than TrueType is currently selected into the device context, the FONTSIGNATURE structure receives zeroes. In this case, use the TranslateCharsetInfo function to obtain generic font-signature information for the character set.
The lpSig parameter can be NULL if you do not need the FONTSIGNATURE information. In this case, you can also call the GetTextCharset function, which is equivalent to calling GetTextCharsetInfo with lpSig set to NULL.
If the function succeeds, the return value identifies the character set of the font currently selected into the specified device context. The following character-set identifiers are defined:
ANSI_CHARSET
BALTIC_CHARSET
CHINESEBIG5_CHARSET
DEFAULT_CHARSET
EASTEUROPE_CHARSET
GB2312_CHARSET
GREEK_CHARSET
HANGUL_CHARSET
MAC_CHARSET
OEM_CHARSET
RUSSIAN_CHARSET
SHIFTJIS_CHARSET
SYMBOL_CHARSET
TURKISH_CHARSET
If the function fails, the return value is DEFAULT_CHARSET.
Windows NT/2000: Requires Windows NT 3.51 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
Unicode and Character Sets Overview, Unicode and Character Set Functions, FONTSIGNATURE, GetTextCharset, TranslateCharsetInfo