Example tutorials for Noto sans fonts in C # support Korean

Source: Internet
Author: User
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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.