13 #define INVALID_CP ((UINT)-1) 19 #define CP_USA 437 // United States (OEM) 21 #define CP_SHIFTJIS 932 // Japanese Shift-JIS 22 #define CP_HANGUL 949 // Korean Hangul/Wansung 23 #define CP_JOHAB 1361 // Korean Johab 24 #define CP_GB2312 936 // Chinese Simplified (GB2312) 25 #define CP_BIG5 950 // Chinese Traditional (Big5) 31 #define CP_JAPANESE CP_SHIFTJIS 32 #define CP_KOREAN CP_HANGUL 33 #define CP_CHINESE_SIMPLIFIED CP_GB2312 34 #define CP_CHINESE_TRADITIONAL CP_BIG5 37 #define IsCJKCodePage(CodePage) \ 38 ((CodePage) == CP_SHIFTJIS || (CodePage) == CP_HANGUL || \ 40 (CodePage) == CP_BIG5 || (CodePage) == CP_GB2312) 42 #if !defined(_WINGDI_) || defined(NOGDI) 43 #define SHIFTJIS_CHARSET 128 44 #define HANGEUL_CHARSET 129 45 #define HANGUL_CHARSET 129 // HANGEUL_CHARSET 47 #define JOHAB_CHARSET 130 49 #define GB2312_CHARSET 134 50 #define CHINESEBIG5_CHARSET 136 54 #define IsCJKCharSet(CharSet) \ 55 ((CharSet) == SHIFTJIS_CHARSET || (CharSet) == HANGUL_CHARSET || \ 57 (CharSet) == GB2312_CHARSET || (CharSet) == CHINESEBIG5_CHARSET) 59 #define IsBoldFont(Weight) \ 60 ((Weight) >= FW_SEMIBOLD) 70 #define BOLD_MARK L'*' 168 #define IsAdditionalTTFont(FaceName) \ 169 (FindCachedTTFont((FaceName), INVALID_CP) != NULL) 171 #define IsAdditionalTTFontCP(FaceName, CodePage) \ 172 (FindCachedTTFont((FaceName), (CodePage)) != NULL) _Inout_updates_z_(LF_FACESIZE) PWSTR FaceName
struct _FONT_DATA * PFONT_DATA
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
VOID InitTTFontCache(VOID)
Initializes the console TrueType font cache.
_In_ HFONT _Out_ PUINT Height
PTT_FONT_ENTRY FindCachedTTFont(_In_reads_or_z_opt_(LF_FACESIZE) PCWSTR FaceName, _In_ UINT CodePage)
Searches for a font in the console TrueType font cache, with the specified code page.
BYTE CodePageToCharSet(_In_ UINT CodePage)
Retrieves the character set associated with a given code page.
VOID ClearTTFontCache(VOID)
Clears the console TrueType font cache.
#define _In_reads_or_z_opt_(size)
struct _TT_FONT_ENTRY TT_FONT_ENTRY
BOOL IsValidConsoleFont(_In_ PCWSTR FaceName, _In_ UINT CodePage)
Validates whether a given font can be supported in the console, under the specified code page.
WCHAR FaceName[LF_FACESIZE]
VOID RefreshTTFontCache(VOID)
Refreshes the console TrueType font cache, by clearing and re-initializing it.
struct _FONT_DATA FONT_DATA
HFONT CreateConsoleFontEx(_In_ LONG Height, _In_opt_ LONG Width, _Inout_updates_z_(LF_FACESIZE) PWSTR FaceName, _In_ ULONG FontWeight, _In_ ULONG FontFamily, _In_ UINT CodePage, _In_ BOOL UseDefaultFallback, _Out_ PFONT_DATA FontData)
Validates and creates a suitable console font based on the font characteristics given in input.
struct _TT_FONT_ENTRY * PTT_FONT_ENTRY
static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo
#define _Inout_updates_z_(size)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
_Success_(return) BOOL GetFontCellSize(_In_opt_ HDC hDC
WCHAR FaceNameAlt[LF_FACESIZE]
HFONT CreateConsoleFont(_Inout_ PCONSOLE_STATE_INFO ConsoleInfo)
A wrapper for CreateConsoleFontEx().
HFONT CreateConsoleFont2(_In_ LONG Height, _In_opt_ LONG Width, _Inout_ PCONSOLE_STATE_INFO ConsoleInfo)
A wrapper for CreateConsoleFontEx().
BOOL IsValidConsoleFont2(_In_ PLOGFONTW lplf, _In_ PNEWTEXTMETRICW lpntm, _In_ DWORD FontType, _In_ UINT CodePage)
Validates whether a given font can be supported in the console, under the specified code page.