ComboBox with Segoe UI and Japanese text

余生颓废 提交于 2019-12-11 02:08:53

问题


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!


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/4157398/combobox-with-segoe-ui-and-japanese-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!