-
Notifications
You must be signed in to change notification settings - Fork 583
fix: font display is irregular for WeaselDeployer. #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The current font is set to “MS Shell Dlg”, which is mapped to “SimSun” on Chinese operating systems instead of the system default font, which throws to very terrible display results. I just changed it to "Segoe UI" and the problem was solved. Q: Why not set it to "Microsoft YaHei" or "Microsoft JhengHei" immediately? A: Since many Chinese users have both fonts on their computers, doing so will most likely result in them being forced to be mapped to the wrong font. Q: Why Segoe UI? A: Because it's Windows's default font for the English version, than can be a fallback to correct fonts for other languages referenced by system fontlink.
it's not in my windows 10 laptop in Chs, it's mapped to you can check for detail information, check this https://learn.microsoft.com/zh-cn/windows/win32/intl/using-ms-shell-dlg-and-ms-shell-dlg-2 |
I think you're right, but it does end up being mapped to " I have checked the Microsoft documentation and this may be a bug from Microsoft, but it is definitely not normal and has been there for a long time. you can check " This is a screenshot of my registry item, also Win10/Chs, OS should be the latest version, and I have not modified it. |
有趣的研究。右邊看上去清楚一些。 |
我記得Windows以前用那種點陣宋體,默認字號還挺清楚的。微軟瞎改? |
好像是因为DPI修改之后的问题,150%比例似乎是会有点虚 |
我在fxliang/weasel 下的pb分支,基本可以不改字体也在不同DPI的显示器下清晰了,FontSettingDialog暂时还没有整合,虽然窗体大小在初始显示器DPI不是96的时候有一点不太正确(偏大),基本可用了 |
感谢研究,但这似乎是另一个问题,也的确存在一个非整数倍缩放(如在我之前的16寸1080P笔记本上,默认缩放倍率为125%)的情况下,文字会发虚的情况,但是在现在的笔记本(2880*1800/200%)就不会。在150%缩放的屏幕上,开启兼容性模式也可以缓解(但我并没有研究过它的原理,似乎是让软件无视掉系统的缩放设置)。 这个PR目的就是替换掉宋体,原因是在Vista引入微软雅黑作为默认字体以后,宋体就不应该再作为GUI应用程序的屏显字体使用了。且目前版本已经放弃对Windows 8以前版本操作系统的兼容,所以我认为,替换为目前Windows的系统默认字体是合理的。 MS Shell Dlg这个逻辑字体是微软规范里的推荐做法,我目前测试,在英文版本操作系统中,它会在注册表 微软大概是出于兼容性考虑,保留了这样的设计规范。因为这两个问题都可以算作GDI的历史遗留问题,而现在的软件通常会直接选择WPF等使用DirectX作为渲染引擎的技术,从一开始就不再兼容Windows XP等系统,自然也不用考虑兼容性问题。 |
补充关于替换掉宋体的原因,之前我给出的150%缩放下的截图是已经开启兼容性设置的,宋体只有在Hint生效被点阵化的情况下,能得到较好的显示效果,而这个界限,通常是1080P/100%缩放。 以Segoe UI为代表(简体中文系统为微软雅黑,繁体中文为微软正黑)的非衬线屏显字体,则可以在1080P及以上分辨率的屏幕上,始终保持较好的显示效果(实际上微软雅黑在125%等非0.5倍数的缩放下,显示效果同样不太好,但宋体只会更糟)。 尽管微软雅黑在低分辨率屏幕上显示效果,可能不如宋体,但考虑到现在的硬件设备,1080P以上分辨率的显示设备已经足够普及,大概只有少数极端情况下受此影响。 刚刚关掉了PR是误操作,十分抱歉。 |
你试试我那个分支的产出吧 |
很抱歉,由于我现在正外出中,没办法使用相同测试环境。 这是在当前笔记本上的测试截图,分辨率为2880*1800,缩放比例为200%,系统环境为en-us,安装了简中及日语语言包,使用二进制文件为d7f25a6。 就目前的测试,似乎这次修改反而导致了控件被放大到了异常大小。但由于在该设备上,原本就不会出现缩放导致的模糊问题,故有待研究。 |
|
The current font is set to “MS Shell Dlg”, which is mapped to “SimSun” on Chinese operating systems instead of the system default font, which throws to very terrible display results.
I just changed it to "Segoe UI" and the problem was solved.
Q: Why not set it to "Microsoft YaHei" or "Microsoft JhengHei" immediately?
A: Since many Chinese users have both fonts on their computers, doing so will most likely result in them being forced to be mapped to the wrong font.
Q: Why Segoe UI?
A: Because it's Windows's default font for the English version, than can be a fallback to correct fonts for other languages referenced by system fontlink.