1, from the Source:
VCU10 project, using the Noto sans font, is really pretty. But the verification under Win7, its display Korean is garbled, quite headache.
Its interface displays
Degree Niang, have Noto sans also have CJK font, as the name implies, its support for CJK, and its large volume, not suitable as a program, continue to think!
2. Font.gdicharset Properties
There is no way, see on the basis of the present, can solve the problem? Program multi-lingual support.
From the font itself to check the properties, verification found that the character set gdiCharSet, the normal display of Korean, the solution has!
Check the information that the font gdiCharSet can have the following values:
Character |
Value |
Ansi |
0 |
DEFAULT |
1 |
Symbol |
2 |
ShiftJIS applicable |
128 |
Korean |
129 |
Korean |
129 |
GB2312 |
134 |
CHINESEBIG5 applicable |
136 |
Oem |
255 |
Korean |
130 |
Hebrew |
177 |
Arabic |
178 |
Greek |
161 |
Turkish |
162 |
Vietnamese |
163 |
Thai |
222 |
Easteurope |
238 |
Russian |
204 |
Mac |
77 |
Polo's language |
186 |
Validation, such as Eastern Europe, the Baltic, and other character sets, can display the normal Korean, without affecting its default character set display effect, so decided to replace its character set.
3. Replace
Project interface has been set font, and many interfaces, a change of course is not convenient, write code batch processing it!
In each form, or in each UserControl, the number of Updatenotosanscharset () is called, and the unification is replaced.
The label font is processed so that the Notosans font can display the Korean public static void Updatenotosanscharset (Form form) {if (osutils.osversion) under Win7. > friendlyosversion.win7) Return;foreach (Control Ctrl in form.) Controls) Updatenotosanscharset (ctrl); } public static void Updatenotosanscharset (ScrollableControl parent) {if (Osutils.osversion > friendlyosversion.win7) Return;foreach (Control Ctrl in parent.) Controls) Updatenotosanscharset (ctrl); } public static void Updatenotosanscharset (Gcontrol ctrl) {if (Ctrl is ScrollableControl) Updatenotosanscharset (Ctrl as ScrollableControl); else if (Ctrl is Label) {//charset takes the Central European character set var font = new Font (CTRL). Font.fontfamily, CTRL. Font.Size, CTRL. Font.style, CTRL. Font.unit, 238); Ctrl. Font = font; } }
4. Effect
OK, problem solving, very perfect: