The GetTextCharsetInfo function obtains information about the character set of the font that is currently selected into a specified device context.
UINT GetTextCharsetInfo(
HDC hdc, |
// handle to device context |
LPFONTSIGNATURE lpSig, |
// pointer to structure to receive Unicode and code page data |
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 codepage 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.
CHINESEBIG5_CHARSET
DEFAULT_CHARSET
GB2312_CHARSET
HANGEUL_CHARSET
OEM_CHARSET
SHIFTJIS_CHARSET
SYMBOL_CHARSET
BALTIC_CHARSET
EASTEUROPE_CHARSET
GREEK_CHARSET
HEBREW_CHARSET
JOHAB_CHARSET
MAC_CHARSET
RUSSIAN_CHARSET
THAI_CHARSET
TURKISH_CHARSET
If the function fails, the return value is DEFAULT_CHARSET.