[WIN32SS][WINSRV] Do CJK font choose workaround (#2134)

Don't choose Asian charset font if there is no preferred font for CJK. CORE-12451
This commit is contained in:
Katayama Hirofumi MZ 2019-12-06 22:18:51 +09:00 committed by GitHub
parent 2f8d847c91
commit 007f32a223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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);