C #: How does the Noto Sans font support Korean,

Source: Internet
Author: User

C #: How does the Noto Sans font support Korean,

1. Source:

The VCU10 project uses the Noto Sans font, which is really beautiful. However, it is a headache to verify that it is garbled in Korean in win7.

Its Interface display

Du Niang, The Noto Sans has a CJK font. As the name suggests, it supports Chinese and Japanese Korean, and its size is huge. It is not suitable as a solution. continue thinking!

 

2. Font. GdiCharSet attributes

There is no way to solve the problem based on the current situation? Multi-language support is required.

Check the font attributes and verify that the GdiCharSet character set can be changed to display Korean. The solution is available!

According to the information, the font GdiCharSet can have the following values:

Character Set

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

Boro

186

Verify that the default Character Set of the Eastern Europe, the Baltic Sea, and other character sets can be normally displayed in Korean without affecting the display effect. Therefore, you decide to replace the character set.

 

3. Replacement

The font has been set on the project interface, and there are many interfaces. it is not convenient to change one interface at a time. Please write code in batch!

In each form or UserControl, call the UpdateNotoSansCharset () number to replace it.

// Process the Label font to display the Korean public static void UpdateNotoSansCharset (Form form) {if (OSUtils. OSVersion> 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 uses the Central European character set var font = new Font (ctrl. font. fontFamily, ctrl. font. size, ctrl. font. style, ctrl. font. units, 238); ctrl. font = font ;}}

 

 4. Effect

OK. The problem is solved perfectly:

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.