Font Support for Windows Phone

來源:互聯網
上載者:User
Windows Phone 

 from sdk for wp7

March 22, 2012

There are two types of fonts on a Windows Phone device:

  • Reading fonts

    These fonts are available on all Windows Phone devices to ensure that a user can read content from anywhere in the world, in any supported language.

  • UI fonts

    Each UI font is associated with a specific display language. Display languages are included with each phone depending on which market the phone was sold in. For example, a phone that is sold in Japan will likely have the Japanese display language included, while a phone that is sold in the United States will likely not have the Japanese display language included. Users can manually switch the display language on a device.

Content on the device is displayed using a corresponding reading font if a corresponding UI font is not available, depending on which display language is set.

For example, suppose a phone includes both a Japanese and English display language option, and the English display language is set on the device. If an application or UI element contains Japanese text, the Japanese reading font will be used to render the text, not the UI font, because the Japanese display language is not set.

For the full list of supported display languages, see Culture and Language Support for Windows Phone.

Fonts and Your Application

While developing your application, it is a good idea to design the application with both reading and UI fonts in mind, especially when dealing with East Asian languages. For example, since the Japanese reading font differs from the Japanese UI font, it's a good idea to test your application in both fonts. You can do this by changing the display language on the device or on the emulator, as described in the How to: Change the Region Settings for Windows Phone Emulator topic.

However, because of how fonts are loaded in XAML, it's important to explicitly add code that defines how the application should handle fonts.

  • If your application is localized for a specific East Asian language such as Japanese, and you want to ensure that the text displays in the expected font for that language, set the language on the outermost PhoneApplicationPage element of the XAML. For example: Language="ja-Jp".

  • Otherwise, add the following code to the constructor in App.xaml.cs:

    RootFrame.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.Name);

    The above code will ensure that your text displays in the font that matches the user's current display language.

Providing Your Own Fonts

If a font that you want to use in your application is unsupported, you can embed the font in your application.

 Caution:

The East Asian language fonts listed in the Supported UI Fonts table are not redistributable for applications.

Font Encoding

Windows Phone uses Unicode to represent characters. Develop your application with Unicode encoding to ensure that your application can run in a global context. You can use the Encoding class to convert encodings from one Unicode type to another Unicode type, for example, UTF-8 to UTF-16.

Characters without Encoding

Non-Unicode characters without encoding information are displayed according to the system locale setting on the phone. The system locale setting is set by the user and represents the default character set and font on the phone.

Yen and Won Characters - ¥ and ₩

The 'Reverse Solidus' Unicode character (U+005C) displays a Yen character in the Japanese display language, and a Won character in the Korean display language. However, because this character will render as a backslash in any other display language, use the 'Yen Sign' Unicode character (U+00A5) and the 'Won Sign' Unicode character (U+20A9) instead to ensure that they always render correctly.

WebBrowser Control

When using a WebBrowser control to display content, or when designing a website to be displayed on a Windows Phone, ensure that you include the correct encoding metadata information in your HTML.

In the following code example, many characters will not render accurately in the WebBrowser instance named BrowserControl, because the string is not correctly encoded.

C# 
string testString = "<html><body>日本列島の佔領の最初の兆候が縄文時代で約14,000のBC。</body></html>";BrowserControl.NavigateToString(testString);

Instead, include encoding information in the HTML content, as described in the following code example.

C# 
string testString = "<html><head><meta content=”text/html; charset=utf-16”/></head><body>日本列島の佔領の最初の兆候が縄文時代で約14,000のBC。</body></html>";BrowserControl.NavigateToString(testString);
Supported UI Fonts in Windows Phone

The following table lists all UI fonts that are supported on a Windows Phone device. Availability of each font for a specific device depends on which display languages are included in the device.

Latin, Cyrillic, and Greek-based Languages

All Latin, Cyrillic, and Greek-based display languages use the UI font Segoe WP. This font is included on all phones, so even if a different display language such as Japanese is set, any Latin, Cyrillic, or Greek-based text will render using the Segoe WP UI font.

The following variations of the Segoe WP font are included on all Windows Phone devices:

  • Segoe WP Light

  • Segoe WP SemiLight

  • Segoe WP

  • Segoe WP Semibold

  • Segoe WP Bold

  • Segoe WP Black

East Asian Languages

 

Language

Font

Regular

Bold

Chinese (Simplified)

DengXian

Chinese (Traditional)

Microsoft MHei

Japanese

Yu Gothic

Korean

Microsoft NeoGothic

Supported Reading Fonts in Windows Phone

The following table lists all reading fonts that are supported on a Windows Phone device.

 

Font Name

Languages

Regular

Bold

Italic

Windows Phone OS 7.0

Windows Phone OS 7.1

Arial

Latin, Cyrillic, and Greek-based languages

Arial Black

Latin, Cyrillic, and Greek-based languages

Calibri

Latin, Cyrillic, and Greek-based languages

Comic Sans MS

Latin, Cyrillic, and Greek-based languages

Georgia

Latin, Cyrillic, and Greek-based languages

Lucida Sans Unicode

Latin, Cyrillic, and Greek-based languages

Malgun Gothic

Korean

Meiryo UI

Japanese

Microsoft YaHei

Chinese (Traditional), Chinese (Simplified)

Segoe UI

Latin, Cyrillic, and Greek-based languages

Segoe UI Symbol

Supports various Unicode symbols, including emoji symbols added in Unicode 6.0.

SimSun

Chinese (Simplified)

Caution:This font is included only on devices that have the Chinese (Simplified) display language.

Tahoma

Latin, Cyrillic, and Greek-based languages

Times New Roman

Latin, Cyrillic, and Greek-based languages

Trebuchet MS

Latin, Cyrillic, and Greek-based languages

Verdana

Latin, Cyrillic, and Greek-based languages

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.