[WIN32SS][WINSRV] Do CJK font choose workaround (#2134)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Fri, 6 Dec 2019 13:18:51 +0000 (22:18 +0900)
committerGitHub <noreply@github.com>
Fri, 6 Dec 2019 13:18:51 +0000 (22:18 +0900)
Don't choose Asian charset font if there is no preferred font for CJK. CORE-12451

win32ss/user/winsrv/concfg/font.c

index 6aa75b0..1c3cbb4 100644 (file)
@@ -69,7 +69,13 @@ CreateConsoleFontEx(
                                  ~(VARIABLE_PITCH | FF_DECORATIVE | FF_ROMAN | FF_SCRIPT | FF_SWISS));
 
     if (!IsValidConsoleFont(FaceName, CodePage))
+    {
         StringCchCopyW(FaceName, LF_FACESIZE, L"Terminal");
+        if (IsCJKCodePage(CodePage))
+        {
+            lf.lfCharSet = ANSI_CHARSET;
+        }
+    }
 
     StringCchCopyNW(lf.lfFaceName, ARRAYSIZE(lf.lfFaceName),
                     FaceName, LF_FACESIZE);