public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Use Microsoft YaHei UI as UI font for Chinese language
@ 2024-04-03 13:19 Yang Yu Lin
  2024-04-11 12:42 ` Jon Turney
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Yu Lin @ 2024-04-03 13:19 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 9029 bytes --]

For Chinese language, the app’s default UI font is Microsoft YaHei UI. Using MS Shell Dlg makes the UI become annoying.
Here are my changes:
diff --git a/res/zh_Hans/res.rc b/res/zh_Hans/res.rc
index 9f67a5a..da9d6e8 100644
--- a/res/zh_Hans/res.rc
+++ b/res/zh_Hans/res.rc
@@ -8,7 +8,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
 IDD_SOURCE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 选择安装类型"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "从互联网安装(&I)\n(下载的文件将保留以备将来重复使用)",IDC_SOURCE_NETINST,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP | BS_MULTILINE | BS_TOP,71,60,200,30
     CONTROL         "下载而不安装(&D)",IDC_SOURCE_DOWNLOAD,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,71,90,200,10
@@ -22,7 +22,7 @@ END
 IDD_VIRUS DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 禁用病毒扫描程序?"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "禁用病毒扫描程序(&D)",IDC_DISABLE_AV,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,101,69,115,10
     CONTROL         "保留病毒扫描程序(&L)",IDC_LEAVE_AV,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,101,84,115,10
@@ -36,7 +36,7 @@ END
 IDD_LOCAL_DIR DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 选择本地软件包目录"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "选择本地软件包目录",IDC_STATIC_HEADER_TITLE,7,0,258,8,NOT WS_GROUP
     LTEXT           "选择希望安装程序存储其下载的安装文件的目录。如果该目录尚不存在,则将创建该目录。",IDC_LOCAL_DIR_DOWNLOAD_DESC,21,9,248,16,NOT WS_GROUP
@@ -51,7 +51,7 @@ END
 IDD_ROOT DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 选择安装目录"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "选择根安装目录",IDC_STATIC_HEADER_TITLE,7,0,258,8,NOT WS_GROUP
     LTEXT           "选择要安装 Cygwin 的目录。以及一些安装参数。",IDC_ROOTDIR_SUBTEXT,21,9,239,16,NOT WS_GROUP
@@ -72,7 +72,7 @@ STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
     WS_CAPTION | WS_SYSMENU
 EXSTYLE WS_EX_CONTROLPARENT
 CAPTION "Cygwin 安装程序 - 选择下载站点"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20
     LISTBOX         IDC_URL_LIST,66,45,185,110,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_HSCROLL | WS_GROUP | WS_TABSTOP
@@ -88,7 +88,7 @@ END
 IDD_NET DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 选择连接类型"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "使用系统代理设置(&S)",IDC_NET_PRECONFIG,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,60,55,185,10
     CONTROL         "直接连接(&D)",IDC_NET_DIRECT,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,60,70,185,10
@@ -108,7 +108,7 @@ IDD_INSTATUS DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_VISIBLE | WS_CAPTION |
     WS_SYSMENU
 CAPTION "Cygwin 安装程序"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "正在安装...",IDC_INS_ACTION,45,55,205,8,SS_ENDELLIPSIS
     LTEXT           "(软件包)",IDC_INS_PKG,45,70,205,8,SS_ENDELLIPSIS
@@ -128,7 +128,7 @@ END
 IDD_PROXY_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "需要代理身份验证"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_CYGWIN,IDC_HEADICON,5,5,21,20
     LTEXT           "代理用户 ID(&U)",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE,WS_EX_RIGHT
@@ -143,7 +143,7 @@ END
 IDD_NET_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "需要服务器身份验证"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_CYGWIN,IDC_HEADICON,5,5,21,20
     LTEXT           "用户 ID(&U)",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE,WS_EX_RIGHT
@@ -159,7 +159,7 @@ IDD_SPLASH DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
     WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "Cygwin 在线安装程序",IDC_STATIC_WELCOME_TITLE,115,1,195,24
     LTEXT           "本安装程序用于 Cygwin 环境的初始安装以及所有后续更新。以下页面将指导您完成安装。\n\n请注意,默认情况下
,我们只安装一组基本的软件包。Cygwin 提供了大量涵盖各种用途的软件包。\n\n您将来可以随时运行此程序,以根据需要添加、删除或升级软件包。",IDC_SPLASH_TEXT,115,25,195,100
@@ -174,7 +174,7 @@ IDD_DESKTOP DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
     WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 安装状态和创建快捷方式"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "在桌面上创建快捷方式(&D)",IDC_ROOT_DESKTOP,"Button",BS_AUTOCHECKBOX,108,78,110,8
     CONTROL         "将快捷方式添加到“开始”菜单(&S)",IDC_ROOT_MENU,"Button",BS_AUTOCHECKBOX,108,93,140,8
@@ -192,7 +192,7 @@ END
 IDD_FTP_AUTH DIALOG 0, 0, SETUP_SMALL_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "需要 FTP 身份验证"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_CYGWIN,IDC_HEADICON,5,5,21,20
     LTEXT           "用户 ID(&U)",IDC_STATIC,5,28,55,15,SS_CENTERIMAGE,WS_EX_RIGHT
@@ -208,7 +208,7 @@ IDD_CHOOSE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION |
     WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 选择软件包"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "视图(&V)",IDC_CHOOSE_VIEWCAPTION,SETUP_VIEW_X,33,SETUP_VIEW_W,10
     COMBOBOX        IDC_CHOOSE_VIEW,SETUP_VIEWLIST_X,30,SETUP_VIEWLIST_W,84,CBS_DROPDOWNLIST | WS_TABSTOP
@@ -233,7 +233,7 @@ IDD_PREREQ DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION |
     WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 解决依赖关系"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,SETUP_STANDARD_DIALOG_W,1
     ICON            IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20
@@ -247,7 +247,7 @@ IDD_CONFIRM DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_VISIBLE | WS_CAPTION |
     WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 审查并确认更改"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,SETUP_STANDARD_DIALOG_W,1
     ICON            IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20
@@ -258,7 +258,7 @@ END
 IDD_DROPPED DIALOG 0, 0, SETUP_STANDARD_DIALOG_W, 142
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 使用非官方镜像?"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     LTEXT           "警告:",IDC_STATIC,7,8,40,8
     LTEXT           "您选择的一个或多个镜像不再在官方 Cygwin 镜像列表中。它/它们可能已过时或缺少某些软件包。\n这会影响以下镜像:",IDC_STATIC,47,8,263,32
@@ -272,7 +272,7 @@ END
 IDD_DOWNLOAD_ERROR DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
 CAPTION "下载不完整"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_WARNING,IDC_HEADICON,10,10
     LTEXT           "以下软件包出现下载错误:",IDC_STATIC,7,8,320,16
@@ -288,7 +288,7 @@ IDD_POSTINSTALL DIALOG 0, 0, SETUP_STANDARD_DIALOG_W, 142
 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_CHILD | WS_VISIBLE |
     WS_CAPTION | WS_SYSMENU
 CAPTION "Cygwin 安装程序 - 执行安装后操作"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     CONTROL         "",IDC_HEADSEPARATOR,"Static",SS_BLACKFRAME | SS_SUNKEN,0,28,SETUP_STANDARD_DIALOG_W,1
     ICON            IDI_CYGWIN,IDC_HEADICON,SETUP_HEADICON_X,0,21,20
@@ -300,7 +300,7 @@ END
 IDD_FILE_INUSE DIALOG 0, 0, SETUP_MEDIUM_DIALOG_DIMS
 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
 CAPTION "检测到正在使用的文件"
-FONT 8, "MS Shell Dlg"
+FONT 9, "Microsoft YaHei UI"
 BEGIN
     ICON            IDI_WARNING,IDC_HEADICON,10,10
     LTEXT           "无法解压缩",IDC_FILE_INUSE_MSG,33,10,234,8,SS_PATHELLIPSIS

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use Microsoft YaHei UI as UI font for Chinese language
  2024-04-03 13:19 Use Microsoft YaHei UI as UI font for Chinese language Yang Yu Lin
@ 2024-04-11 12:42 ` Jon Turney
  2024-04-11 14:40   ` Brian Inglis
  2024-04-16 18:46   ` Jon Turney
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Turney @ 2024-04-11 12:42 UTC (permalink / raw)
  To: Yang Yu Lin; +Cc: cygwin

On 03/04/2024 14:19, Yang Yu Lin via Cygwin wrote:
> For Chinese language, the app’s default UI font is Microsoft YaHei UI. Using MS Shell Dlg makes the UI become annoying.
> Here are my changes:
> diff --git a/res/zh_Hans/res.rc b/res/zh_Hans/res.rc
> index 9f67a5a..da9d6e8 100644
> --- a/res/zh_Hans/res.rc
> +++ b/res/zh_Hans/res.rc
> @@ -8,7 +8,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
>   IDD_SOURCE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
>   STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
>   CAPTION "Cygwin 安装程序 - 选择安装类型"
> -FONT 8, "MS Shell Dlg"
> +FONT 9, "Microsoft YaHei UI"

Thanks very much for this patch!

So, this isn't applicable as is, because the localized res.rc files are 
generated from a template res.rc file and the language .po file (using 
po2rc from Translate Toolkit [1][2]).  See section starting after "rules 
for translation maintenance" in Makefile.am

However, this seems like it would be straightforward to do via a 
post-processing step there.

I'll take your word over the aesthetics of the font choice, but I do 
have a question about what versions of Windows we can assume that font 
is available on (in theory at least, one might be using a current setup 
executable to install Cygwin from the CTM on OSs back to Windows XP3)

I wonder if we ought to be using "MS Shell Dlg 2" and/or DS_SHELLFONT, 
but the documentation about those is incomprehensible.



If you have any future patches to setup, please send them to the 
cygwin-apps mailing list


[1] https://github.com/translate/translate
[2] (Although there may be some patches needed which have yet to make it 
upstream, so this might not work for you, yet)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use Microsoft YaHei UI as UI font for Chinese language
  2024-04-11 12:42 ` Jon Turney
@ 2024-04-11 14:40   ` Brian Inglis
  2024-04-16 18:46   ` Jon Turney
  1 sibling, 0 replies; 4+ messages in thread
From: Brian Inglis @ 2024-04-11 14:40 UTC (permalink / raw)
  To: cygwin

On 2024-04-11 06:42, Jon Turney via Cygwin wrote:
> On 03/04/2024 14:19, Yang Yu Lin via Cygwin wrote:
>> For Chinese language, the app’s default UI font is Microsoft YaHei UI. Using 
>> MS Shell Dlg makes the UI become annoying.
>> Here are my changes:
>> diff --git a/res/zh_Hans/res.rc b/res/zh_Hans/res.rc
>> index 9f67a5a..da9d6e8 100644
>> --- a/res/zh_Hans/res.rc
>> +++ b/res/zh_Hans/res.rc
>> @@ -8,7 +8,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
>>   IDD_SOURCE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
>>   STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
>>   CAPTION "Cygwin 安装程序 - 选择安装类型"
>> -FONT 8, "MS Shell Dlg"
>> +FONT 9, "Microsoft YaHei UI"

> Thanks very much for this patch!
> So, this isn't applicable as is, because the localized res.rc files are 
> generated from a template res.rc file and the language .po file (using po2rc 
> from Translate Toolkit [1][2]).  See section starting after "rules for 
> translation maintenance" in Makefile.am
> However, this seems like it would be straightforward to do via a post-processing 
> step there.
> I'll take your word over the aesthetics of the font choice, but I do have a 
> question about what versions of Windows we can assume that font is available on 
> (in theory at least, one might be using a current setup executable to install 
> Cygwin from the CTM on OSs back to Windows XP3)

MS Yahei UI appeared in Win8; Yahei Reg/Bold in Win7.

> I wonder if we ought to be using "MS Shell Dlg 2" and/or DS_SHELLFONT, but the 
> documentation about those is incomprehensible.

They appear to be intended to be "localizable" font names implemented using font 
substitution on each Windows language version to MS Sans Serif (MS UI Gothic if 
jp) and Tahoma (2 was for W2K):

https://learn.microsoft.com/en-us/windows/win32/intl/using-ms-shell-dlg-and-ms-shell-dlg-2
https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/Intl/using-ms-shell-dlg-and-ms-shell-dlg-2.md

> If you have any future patches to setup, please send them to the cygwin-apps 
> mailing list
> [1] https://github.com/translate/translate
> [2] (Although there may be some patches needed which have yet to make it 
> upstream, so this might not work for you, yet)

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Use Microsoft YaHei UI as UI font for Chinese language
  2024-04-11 12:42 ` Jon Turney
  2024-04-11 14:40   ` Brian Inglis
@ 2024-04-16 18:46   ` Jon Turney
  1 sibling, 0 replies; 4+ messages in thread
From: Jon Turney @ 2024-04-16 18:46 UTC (permalink / raw)
  To: Yang Yu Lin; +Cc: cygwin

On 11/04/2024 13:42, Jon Turney via Cygwin wrote:
> On 03/04/2024 14:19, Yang Yu Lin via Cygwin wrote:
>> For Chinese language, the app’s default UI font is Microsoft YaHei UI. 
>> Using MS Shell Dlg makes the UI become annoying.
>> Here are my changes:
>> diff --git a/res/zh_Hans/res.rc b/res/zh_Hans/res.rc
>> index 9f67a5a..da9d6e8 100644
>> --- a/res/zh_Hans/res.rc
>> +++ b/res/zh_Hans/res.rc
>> @@ -8,7 +8,7 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
>>   IDD_SOURCE DIALOG 0, 0, SETUP_STANDARD_DIALOG_DIMS
>>   STYLE DS_MODALFRAME | DS_CENTER | WS_CHILD | WS_CAPTION | WS_SYSMENU
>>   CAPTION "Cygwin 安装程序 - 选择安装类型"
>> -FONT 8, "MS Shell Dlg"
>> +FONT 9, "Microsoft YaHei UI"
> 
> Thanks very much for this patch!
> 
> So, this isn't applicable as is, because the localized res.rc files are 
> generated from a template res.rc file and the language .po file (using 
> po2rc from Translate Toolkit [1][2]).  See section starting after "rules 
> for translation maintenance" in Makefile.am
> 
> However, this seems like it would be straightforward to do via a 
> post-processing step there.

I added this.

It seems this makes the whole dialog bigger (presumably since it's sized 
in DLU, which are based on the font metrics, which are different for 
this font).

> I'll take your word over the aesthetics of the font choice, but I do 
> have a question about what versions of Windows we can assume that font 
> is available on (in theory at least, one might be using a current setup 
> executable to install Cygwin from the CTM on OSs back to Windows XP3)

I've build an updated setup with these changes [1].  Please give this a 
try and see if it looks better to you.

[1] https://cygwin.com/setup/setup-2.932.x86_64.exe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-16 18:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 13:19 Use Microsoft YaHei UI as UI font for Chinese language Yang Yu Lin
2024-04-11 12:42 ` Jon Turney
2024-04-11 14:40   ` Brian Inglis
2024-04-16 18:46   ` Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).