带有 Segoe UI 和日语文本的组合框
我目前正在尝试使我的 C# 应用程序在 Windows Vista 或 Windows 7 中运行时看起来更好。默认情况下,Windows 窗体应用程序使用 Microsoft Sans Serif 字体,该字体无法正确链接到亚洲清晰类型诸如Meiryo之类的字体。
为了解决此问题,我将所有字体设置为 Segoe UI(或 SystemFonts.MessageBoxFont
)。这对于大多数控件来说效果很好,但我注意到它至少会导致 ComboBox
控件出现奇怪的显示故障:
ComboBox
无法正确显示此列表。字符被奇怪地裁剪,并且所选项目看起来需要比最初保留的空间更多的空间。
对于这种行为有任何解决方案或解决方法吗?
如果您想亲自尝试一下,这是我的项目清单:
- テsuto
- てすと
- 実験
谢谢!
I’m currently trying to make my C# application look better when run within Windows Vista or Windows 7. By default, Windows Forms applications use the Microsoft Sans Serif font, which does not link properly to Asian clear type fonts such as Meiryo.
To fix this issue, I set all the fonts to Segoe UI (or SystemFonts.MessageBoxFont
) instead. This works quite well for most of Controls, but I noticed it causes weird display glitches with at least the ComboBox
control:
The ComboBox
fails to display this list correctly. Characters get cropped oddly and the selected item looks like it requires more space than originally reserved.
Is there any solution or workaround to this behaviour?
In case you want to try it for yourself, here's my list of items:
- テスト
- てすと
- 実験
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在Win7上重现。字体映射器中的某些东西看起来很卡顿,替代字体显然太大了。值得注意的是,Microsoft Sans Serif 不会出现此问题。它在我的机器上映射得很好。
在这里很难提供廉价的建议,您确实需要 Microsoft 支持的帮助。您还应该在日语版本的 Windows 上检查它,它很有可能具有不需要映射的字体。
I repro on Win7. Something is borked in the font mapper by the looks of it, the substitute font is clearly too large. Notable is the problem does not occur with Microsoft Sans Serif. And it maps just fine on my machine.
Tough to give cheap advice here, you really need the help from Microsoft Support. You also ought to check it on the Japanese version of Windows, odds are decent that it will have fonts that don't require mapping.
我有一个类似的问题(但有一些其他字符和字体)不确定它是否适合您,但实现 DrawItem 事件并自己绘制文本非常简单。
我们使用与此类似的方法:https://stackoverflow.com/a/857232/417721
I had a similar problem (but with some other characters and font) not sure if it will work for you but it is quite simple to implement the DrawItem event and draw the text yourself.
We use a method similar to this: https://stackoverflow.com/a/857232/417721