[PATCH 0/1] MR10905: win32u: Update CJK font defaults to use modern UI fonts.
Windows 10/11 uses Segoe UI as the primary system UI font with locale-dependent FontLink SystemLink that was completely missing in Wine. Add it. The hardcoded fallback in create_child_font_list() that chains Microsoft Sans Serif and Tahoma for any non-SYMBOL font means the first CJK font in Tahoma's SystemLink was always reached first. Reorder the locale-specific Tahoma/MS Sans Serif/Lucida Sans Unicode SystemLink arrays so the modern CJK UI font for each locale is tried first. Update the MS Shell Dlg FontSubstitute mapping from the legacy CJK fonts (SimSun, PMingLiU, MS UI Gothic, Gulim) to the modern equivalents (Microsoft YaHei UI, JhengHei UI, Yu Gothic UI, Malgun Gothic). Without this, applications using MS Shell Dlg would always render CJK text in the legacy font regardless of the Tahoma SystemLink order. |{width=309 height=307}|{width=357 height=416}| |---|---| |Before|After| Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59733 Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com> -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10905
From: Zhou Qiankang <wszqkzqk@qq.com> Windows 10/11 uses Segoe UI as the primary system UI font with locale-dependent FontLink SystemLink that was completely missing in Wine. Add it. The hardcoded fallback in create_child_font_list() that chains Microsoft Sans Serif and Tahoma for any non-SYMBOL font means the first CJK font in Tahoma's SystemLink was always reached first. Reorder the locale-specific Tahoma/MS Sans Serif/Lucida Sans Unicode SystemLink arrays so the modern CJK UI font for each locale is tried first. Update the MS Shell Dlg FontSubstitute mapping from the legacy CJK fonts (SimSun, PMingLiU, MS UI Gothic, Gulim) to the modern equivalents (Microsoft YaHei UI, JhengHei UI, Yu Gothic UI, Malgun Gothic). Without this, applications using MS Shell Dlg would always render CJK text in the legacy font regardless of the Tahoma SystemLink order. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=59733 Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com> --- dlls/win32u/font.c | 93 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 9 deletions(-) diff --git a/dlls/win32u/font.c b/dlls/win32u/font.c index dcc75e8096b..4fbcc6082b7 100644 --- a/dlls/win32u/font.c +++ b/dlls/win32u/font.c @@ -441,22 +441,22 @@ static const struct nls_update_font_list /* Japanese */ { 932, 932, "vga932.fon", "jvgafix.fon", "jvgasys.fon", "coure.fon", "serife.fon", "jsmalle.fon", "sserife.fon", "sseriff.fon", - "MS UI Gothic","MS Serif" + "Yu Gothic UI","MS Serif" }, /* Chinese Simplified */ { 936, 936, "vga936.fon", "svgafix.fon", "svgasys.fon", "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", "sseriff.fon", - "SimSun", "NSimSun" + "Microsoft YaHei UI", "NSimSun" }, /* Korean */ { 949, 949, "vga949.fon", "hvgafix.fon", "hvgasys.fon", "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", "sseriff.fon", - "Gulim", "Batang" + "Malgun Gothic", "Batang" }, /* Chinese Traditional */ { 950, 950, "vga950.fon", "cvgafix.fon", "cvgasys.fon", "coure.fon", "serife.fon", "smalle.fon", "sserife.fon", "sseriff.fon", - "PMingLiU", "MingLiU" + "Microsoft JhengHei UI", "MingLiU" } }; @@ -1565,6 +1565,8 @@ static const WCHAR yu_gothic_ui_semilightW[] = {'Y','u',' ','G','o','t','h','i','c',' ','U','I',' ','S','e','m','i','l','i','g','h','t',0}; static const WCHAR yu_gothic_ui_semiboldW[] = {'Y','u',' ','G','o','t','h','i','c',' ','U','I',' ','S','e','m','i','b','o','l','d',0}; +static const WCHAR segoe_uiW[] = + {'S','e','g','o','e',' ','U','I',0}; static const WCHAR meiryoW[] = {'M','e','i','r','y','o',0}; static const WCHAR meiryo_boldW[] = @@ -1619,58 +1621,123 @@ static const struct font_links_defaults_list }; static const char system_link_tahoma_sc[] = + "MSYH.TTC,Microsoft YaHei UI\0" "SIMSUN.TTC,SimSun\0" "MINGLIU.TTC,PMingLiu\0" "MSGOTHIC.TTC,MS UI Gothic\0" "BATANG.TTC,Batang\0" - "MSYH.TTC,Microsoft YaHei UI\0" "MSJH.TTC,Microsoft JhengHei UI\0" "YUGOTHM.TTC,Yu Gothic UI\0" "MALGUN.TTF,Malgun Gothic\0" "SEGUISYM.TTF,Segoe UI Symbol\0"; static const char system_link_tahoma_tc[] = + "MSJH.TTC,Microsoft JhengHei UI\0" "MINGLIU.TTC,PMingLiu\0" "SIMSUN.TTC,SimSun\0" "MSGOTHIC.TTC,MS UI Gothic\0" "BATANG.TTC,Batang\0" - "MSJH.TTC,Microsoft JhengHei UI\0" "MSYH.TTC,Microsoft YaHei UI\0" "YUGOTHM.TTC,Yu Gothic UI\0" "MALGUN.TTF,Malgun Gothic\0" "SEGUISYM.TTF,Segoe UI Symbol\0"; static const char system_link_tahoma_jp[] = + "YUGOTHM.TTC,Yu Gothic UI\0" "MSGOTHIC.TTC,MS UI Gothic\0" "MINGLIU.TTC,PMingLiU\0" "SIMSUN.TTC,SimSun\0" "GULIM.TTC,Gulim\0" - "YUGOTHM.TTC,Yu Gothic UI\0" "MSJH.TTC,Microsoft JhengHei UI\0" "MSYH.TTC,Microsoft YaHei UI\0" "MALGUN.TTF,Malgun Gothic\0" "SEGUISYM.TTF,Segoe UI Symbol\0"; static const char system_link_tahoma_kr[] = + "MALGUN.TTF,Malgun Gothic\0" "GULIM.TTC,Gulim\0" "MSGOTHIC.TTC,MS UI Gothic\0" "MINGLIU.TTC,PMingLiU\0" "SIMSUN.TTC,SimSun\0" - "MALGUN.TTF,Malgun Gothic\0" + "MSYH.TTC,Microsoft YaHei UI\0" + "MSJH.TTC,Microsoft JhengHei UI\0" + "YUGOTHM.TTC,Yu Gothic UI\0" + "SEGUISYM.TTF,Segoe UI Symbol\0"; + +static const char system_link_tahoma_non_cjk[] = + "MSGOTHIC.TTC,MS UI Gothic\0" + "MINGLIU.TTC,PMingLiU\0" + "SIMSUN.TTC,SimSun\0" + "GULIM.TTC,Gulim\0" "YUGOTHM.TTC,Yu Gothic UI\0" "MSJH.TTC,Microsoft JhengHei UI\0" "MSYH.TTC,Microsoft YaHei UI\0" + "MALGUN.TTF,Malgun Gothic\0" "SEGUISYM.TTF,Segoe UI Symbol\0"; -static const char system_link_tahoma_non_cjk[] = +static const char system_link_segoe_ui_non_cjk[] = + "TAHOMA.TTF,Tahoma\0" + "MEIRYO.TTC,Meiryo UI\0" "MSGOTHIC.TTC,MS UI Gothic\0" + "MSJH.TTC,Microsoft JhengHei UI\0" + "MSYH.TTC,Microsoft YaHei UI\0" + "MALGUN.TTF,Malgun Gothic\0" "MINGLIU.TTC,PMingLiU\0" "SIMSUN.TTC,SimSun\0" "GULIM.TTC,Gulim\0" "YUGOTHM.TTC,Yu Gothic UI\0" + "SEGUISYM.TTF,Segoe UI Symbol\0"; + +static const char system_link_segoe_ui_sc[] = + "TAHOMA.TTF,Tahoma\0" + "MSYH.TTC,Microsoft YaHei UI\0" + "SIMSUN.TTC,SimSun\0" + "MEIRYO.TTC,Meiryo UI\0" + "MSGOTHIC.TTC,MS UI Gothic\0" "MSJH.TTC,Microsoft JhengHei UI\0" + "MALGUN.TTF,Malgun Gothic\0" + "MINGLIU.TTC,PMingLiU\0" + "GULIM.TTC,Gulim\0" + "YUGOTHM.TTC,Yu Gothic UI\0" + "SEGUISYM.TTF,Segoe UI Symbol\0"; + +static const char system_link_segoe_ui_tc[] = + "TAHOMA.TTF,Tahoma\0" + "MSJH.TTC,Microsoft JhengHei UI\0" + "MINGLIU.TTC,PMingLiU\0" + "MEIRYO.TTC,Meiryo UI\0" + "MSGOTHIC.TTC,MS UI Gothic\0" "MSYH.TTC,Microsoft YaHei UI\0" "MALGUN.TTF,Malgun Gothic\0" + "SIMSUN.TTC,SimSun\0" + "GULIM.TTC,Gulim\0" + "YUGOTHM.TTC,Yu Gothic UI\0" + "SEGUISYM.TTF,Segoe UI Symbol\0"; + +static const char system_link_segoe_ui_jp[] = + "TAHOMA.TTF,Tahoma\0" + "MEIRYO.TTC,Meiryo UI\0" + "YUGOTHM.TTC,Yu Gothic UI\0" + "MSGOTHIC.TTC,MS UI Gothic\0" + "MSJH.TTC,Microsoft JhengHei UI\0" + "MSYH.TTC,Microsoft YaHei UI\0" + "MALGUN.TTF,Malgun Gothic\0" + "MINGLIU.TTC,PMingLiU\0" + "SIMSUN.TTC,SimSun\0" + "GULIM.TTC,Gulim\0" + "SEGUISYM.TTF,Segoe UI Symbol\0"; + +static const char system_link_segoe_ui_kr[] = + "TAHOMA.TTF,Tahoma\0" + "MALGUN.TTF,Malgun Gothic\0" + "GULIM.TTC,Gulim\0" + "MEIRYO.TTC,Meiryo UI\0" + "MSGOTHIC.TTC,MS UI Gothic\0" + "MSJH.TTC,Microsoft JhengHei UI\0" + "MSYH.TTC,Microsoft YaHei UI\0" + "MINGLIU.TTC,PMingLiU\0" + "SIMSUN.TTC,SimSun\0" + "YUGOTHM.TTC,Yu Gothic UI\0" "SEGUISYM.TTF,Segoe UI Symbol\0"; static const char system_link_ms_gothic[] = @@ -1928,6 +1995,14 @@ static const struct system_link_reg } default_system_link[] = { + { + segoe_uiW, TRUE, + system_link_segoe_ui_non_cjk, sizeof(system_link_segoe_ui_non_cjk), + system_link_segoe_ui_sc, sizeof(system_link_segoe_ui_sc), + system_link_segoe_ui_tc, sizeof(system_link_segoe_ui_tc), + system_link_segoe_ui_jp, sizeof(system_link_segoe_ui_jp), + system_link_segoe_ui_kr, sizeof(system_link_segoe_ui_kr), + }, { tahomaW, TRUE, system_link_tahoma_non_cjk, sizeof(system_link_tahoma_non_cjk), -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10905
This indeed looks much better. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10905#note_139915
participants (3)
-
Zhiyi Zhang (@zhiyi) -
Zhou Qiankang -
Zhou Qiankang (@wszqkzqk)