Cygwin: console: don't hang in check_font with raster fonts

EnumFontFamiliesExW fails if the font is "Terminal" (aka "Raster Fonts")
and lfCharSet requests ANSI_CHARSET.  Using DEFAULT_CHARSET fixes this.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-09-07 13:43:48 +02:00
parent bd993df0e6
commit 60471176fd
1 changed files with 2 additions and 2 deletions

View File

@ -2009,7 +2009,7 @@ check_font (HANDLE hdl)
return;
/* Some FaceNames like DejaVu Sans Mono are sometimes returned with stray
trailing chars. Fix it. */
lf.lfCharSet = ANSI_CHARSET;
lf.lfCharSet = DEFAULT_CHARSET;
lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
wchar_t *cp = wcpcpy (lf.lfFaceName, cfi.FaceName) - 1;
int done = 0;
@ -2023,7 +2023,7 @@ check_font (HANDLE hdl)
/* Yes. Check for the best replacement char. */
HFONT f = CreateFontW (0, 0, 0, 0,
cfi.FontWeight, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
FIXED_PITCH | FF_DONTCARE, lf.lfFaceName);
if (!f)