diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2018-09-07 13:43:48 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2018-09-07 13:44:44 +0200 |
commit | 60471176fd37102139ddc55b3e7ce9561ea56fc5 (patch) | |
tree | df796fa59acc834765716ab5caa877d71b2cc995 | |
parent | bd993df0e6aee5080a791b54cb0074ad76bab681 (diff) | |
download | newlib-60471176fd37102139ddc55b3e7ce9561ea56fc5.zip newlib-60471176fd37102139ddc55b3e7ce9561ea56fc5.tar.gz newlib-60471176fd37102139ddc55b3e7ce9561ea56fc5.tar.bz2 |
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>
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index dfb78d4..d53b53e 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) |