@@ -32,47 +32,18 @@ static int non_ascii_used = 0;
3232static HANDLE hthread , hread , hwrite ;
3333static HANDLE hconsole1 , hconsole2 ;
3434
35- #ifdef __MINGW32__
36- #if !defined(__MINGW64_VERSION_MAJOR ) || __MINGW64_VERSION_MAJOR < 5
37- typedef struct _CONSOLE_FONT_INFOEX {
38- ULONG cbSize ;
39- DWORD nFont ;
40- COORD dwFontSize ;
41- UINT FontFamily ;
42- UINT FontWeight ;
43- WCHAR FaceName [LF_FACESIZE ];
44- } CONSOLE_FONT_INFOEX , * PCONSOLE_FONT_INFOEX ;
45- #endif
46- #endif
47-
4835static void warn_if_raster_font (void )
4936{
5037 DWORD fontFamily = 0 ;
51- DECLARE_PROC_ADDR (kernel32 .dll , BOOL , WINAPI ,
52- GetCurrentConsoleFontEx , HANDLE , BOOL ,
53- PCONSOLE_FONT_INFOEX );
38+ CONSOLE_FONT_INFOEX cfi ;
5439
5540 /* don't bother if output was ascii only */
5641 if (!non_ascii_used )
5742 return ;
5843
59- /* GetCurrentConsoleFontEx is available since Vista */
60- if (INIT_PROC_ADDR (GetCurrentConsoleFontEx )) {
61- CONSOLE_FONT_INFOEX cfi ;
62- cfi .cbSize = sizeof (cfi );
63- if (GetCurrentConsoleFontEx (console , 0 , & cfi ))
64- fontFamily = cfi .FontFamily ;
65- } else {
66- /* pre-Vista: check default console font in registry */
67- HKEY hkey ;
68- if (ERROR_SUCCESS == RegOpenKeyExA (HKEY_CURRENT_USER , "Console" ,
69- 0 , KEY_READ , & hkey )) {
70- DWORD size = sizeof (fontFamily );
71- RegQueryValueExA (hkey , "FontFamily" , NULL , NULL ,
72- (LPVOID ) & fontFamily , & size );
73- RegCloseKey (hkey );
74- }
75- }
44+ cfi .cbSize = sizeof (cfi );
45+ if (GetCurrentConsoleFontEx (console , 0 , & cfi ))
46+ fontFamily = cfi .FontFamily ;
7647
7748 if (!(fontFamily & TMPF_TRUETYPE )) {
7849 const wchar_t * msg = L"\nWarning: Your console font probably "
0 commit comments