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