Open Scott0902 opened 5 hours ago
我的系统是Windows 10,显示器分辨率1920*1200,系统的缩放比例是125%,v2rayN的字体大小设为14。 为详细说明我的问题,我附上图片说明。 首先默认的微软雅黑字体带hinting(这是长期诟病的字体高低不平现象):
然后经过TtfAutoHint工具去掉微软雅黑的hinting后,v2rayN显示的微软雅黑虽然没有高低不平,但线条的粗细不一:
最后我修改源代码的xaml文件,需要修改的xaml文件包括: AddServer2Window.xaml AddServerWindow.xaml DNSSettingWindow.xaml GlobalHotkeySettingWindow.xaml MainWindow.xaml OptionSettingWindow.xaml RoutingRuleDetailsWindow.xaml RoutingRuleSettingWindow.xaml RoutingSettingWindow.xaml SubEditWindow.xaml SubSettingWindow.xaml
把以上xaml文件的下面两行:
TextOptions.TextFormattingMode="Display"
TextOptions.TextRenderingMode="Auto"
改为下面三行:
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="ClearType"
TextOptions.TextHintingMode="Fixed"
运行build.ps1编译后,v2RayN显示的微软雅黑变得很圆滑,媲美macType渲染的效果:
相关问题
默认的微软雅黑字体在低分屏下总会使用臭名昭著的hinting显示,导致中文字体高低不平,只有在系统缩放比例在200%或以上,字体才不使用hinting。但并非所有人都有高分屏,我的系统缩放比例是125%,而且已通过TtfAutoHint工具去掉微软雅黑字体的所有hinting,使得大部分情况下微软雅黑字体都渲染得很平滑。由于v2rayN采用WPF字体渲染机制,即使我去掉微软雅黑的hinting,当前的v2rayN仍强制使用hinting算法渲染字体,字体显得怪异。
描述你希望的解决方案
我建议修改源代码的xaml文件,修改
TextOptions
,增加一行TextOptions.TextHintingMode="Fixed"
,还要把TextOptions.TextFormattingMode
的值由"Display"
改为"Ideal"
,以及TextOptions.TextRenderingMode
的值由"Auto
改为"ClearType"
。描述你所考虑的替代方案
No response
我确认已查询历史issues