From 60471176fd37102139ddc55b3e7ce9561ea56fc5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 7 Sep 2018 13:43:48 +0200 Subject: [PATCH] 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 --- winsup/cygwin/fhandler_console.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index dfb78d4ac..d53b53e98 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -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)