How to display Unicode characters in the correct font? (C # / WinForms)

My application correctly handles different types of character sets, but only internally - when it comes to displaying text in standard WinForms shortcuts and text fields, it seems to have problems with Chinese characters.

The problem is using the font (Tahoma), because when I copy and paste text or view it in the debugger, it displays correctly. Also, when I set MS Mincho as the font used, the characters on the screen look normal.

Of course, I do not want to use MS Mincho throughout the application. Do I need to change the font depending on the characters displayed, or is there a better way that I skipped?

+6
c # unicode winforms rendering
source share
2 answers

UniScribe , which was introduced in Windows 2000, should handle this transparently, which means that it will automatically use a different font (for example, Mincho) for characters that are not in the selected font. That's why it looks correct in the debugger, although the font used in the debugger does not contain Chinese characters. Perhaps you are doing something that disables UniScribe, or is a problem in some other way. Perhaps if you could insert the code, it would be easier to identify the problem.

+4
source share

All fonts do not have data for all glyphs that can be expressed in Unicode. You need to find a suitable font that has the subset that you want.

edit: just to clarify, there are fonts that cover the full Unicode range, but the one you are using now is not one of them.

0
source share

All Articles