East Asian font size adjustments

This commit is contained in:
Lim Chunwei 2021-11-17 00:06:19 +08:00
parent 008cf68b06
commit 5ad75bb0ef
1 changed files with 6 additions and 1 deletions

View File

@ -441,7 +441,6 @@ void gdrv::grtext_draw_ttext_in_box(LPCWSTR text, int xOff, int yOff, int width,
yOff = static_cast<int>(yOff * fullscrn::ScaleY) + fullscrn::OffsetY;
width = static_cast<int>(width * fullscrn::ScaleX);
height = static_cast<int>(height * fullscrn::ScaleY);
auto fontSize = static_cast<int>(round(fontSizes[fullscrn::GetResolution()] * fullscrn::ScaleY));
HDC dc = GetDC(hwnd);
tagRECT rc{};
@ -460,24 +459,30 @@ void gdrv::grtext_draw_ttext_in_box(LPCWSTR text, int xOff, int yOff, int width,
}
const char* font;
int fontSizeChange = 0;
switch (options::Options.Language)
{
case Languages::TraditionalChinese:
font = "Microsoft JhengHei";
fontSizeChange = 4;
break;
case Languages::SimplifiedChinese:
font = "Microsoft YaHei";
fontSizeChange = 4;
break;
case Languages::Japanese:
font = "MS UI Gothic";
break;
case Languages::Korean:
font = "Gulim";
fontSizeChange = 4;
break;
default:
font = "Arial";
}
auto fontSize = static_cast<int>(round((fontSizes[fullscrn::GetResolution()] + fontSizeChange) * fullscrn::ScaleY));
// Default font does not scale well
auto hNewFont = CreateFont(fontSize, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,