Windows Phone 的字体和语言配置支持

适用于: Windows Phone 8 | Windows Phone OS 7.1

Windows Phone 8 支持世界书写体系中大多数的字体。尽管手机客户端 UI 已本地化为 50 种主要语言,应用可以显示更多的语言选择。Windows Phone 8 和 Windows Phone OS 7.1 均可支持每种语言的一种(通常一种以上)的字体系列。

本主题包含以下各节。

对于 Windows Phone 8,所有手机版本均可显示所有字体。然而,对于 Windows Phone OS 7.1,尽管对每种受支持的语言提供了至少一种字体,但某些额外的语言特定的字体仅在使用这些语言的市场中提供。

自定义嵌入字体

应用还会嵌入字体,以提供未包括在手机中的字样。

文本输入

用于已预安装键盘和输入方法 UI 的手机的语言选择,取决于手机将在哪个市场中出售。任何时候用户都可以下载和使用 50 种受支持的手机客户端 UI 语言中任意语言的键盘。用于确定写入 TextBox 控件的字符的键盘语言,无法以编程的方式提供给应用。

xaml:lang 在字体上的影响

Windows Phone 显示应用指定的 FontFamily 中的文本。如果字符不受 FontFamily 支持,或者应用未指定 FontFamily,Windows Phone 将基于字符和用于显示文本的框架元素的 xml:lang 选择一种字体。

在 Windows Phone 上,xml:lang 驱动备用字体选择、复杂字符造型和数据绑定中的类型转换。此外,第三方控件的行为通常以 xml:lang 为基础,例如日期选择器。

显示文本的框架元素的 xml:lang 特性可以通过应用代码进行更改。通常使用控件的 Language 特性设置或检索该特性。如果应用不指定 XAML 标记中或代码隐藏中元素的 Language,它将从其父元素继承值。如果未指定应用的根元素的 Language,它将是“en-US”。如果您添加支持的语言以本地化应用,请注意“新建项目”模板包含从加载的本地化资源文件选取应用语言的代码,并在默认情况下将其指定到 RootFrame.Language

Unicode 码位和语言

由于固有的 Unicode 功能,在某些情况下只是简单地指定正确的 Unicode 值可能不会呈现预期的字体。对于东亚语言和使用复杂脚本编写的语言,指定正确的元素的 Language 值来显示字体非常重要。这些包括由代码“zh-CN”、“zh-TW”、“ja-JP”和“ko-KR”描写的区域设置以及使用阿拉伯语、西里尔语和德温那格利脚本编写的语言的区域设置。

有关受支持的显示语言的完整列表,请参见 Windows Phone 的区域性和语言支持

如概述中所述,新项目的默认行为是指,正在运行的应用的 Language 属性将使用来自应用启动时加载的资源文件(ResourceLanguage 和 ResourceFlowDirection)中的参数进行初始化。此行为将施加一种模式,即字体和文本流方向对齐在运行时显示的资源的语言。

将额外的语言(支持的区域性)添加到应用时,Visual Studio 将为每种语言生成新的 .resx 文件。它将支持的区域性的区域 ID 代码 (LCID) 插入到文件名。Visual Studio 还会初始化语言参数的字符串表值,以匹配资源文件的区域设置的语言以及其脚本的传统流方向。

App.xaml.cs 文件中的 InitializeLanguage() 函数基于 AppResoures.ResourceLanguage 资源的值设置应用的 RootFrame.Language 并基于 AppResources.ResourceFlowDirection 资源的值设置其RootFrame.lowDirection

如果此处描述的 Language 对齐的默认模式不适用于您的应用设计,您可以采用多种方法重写任何区域设置的默认语言和流方向。下面列出了一些方法。如果您决定中断默认的行为,请记住当任意控件显示东亚语言和复杂的脚本语言时,您需要在控件中显式地设置 Language 值。

  • 如果您想要从头开始,您可以在 App.xaml.cs 中注释掉应用的 InitializeLanguage 方法。

  • 如果您想要全局性地施加特定的语言,而不管用户为他们的手机显示语言选择了何种区域设置,您可以在应用的每个 .resx 文件中修改 RootLanguage 字符串。

  • 如果您希望 FlowDirection 全部朝一个方向流动,而不管应用运行时语言的传统方向,您可以在应用的 .resx 文件中修改 ResourceFlowDirection 字符串。

  • 如果您想要特定的元素(或元素的集合)使用特定的语言,请将应用的默认InitializeLanguage 模式保留在原位,并且通过在 XAML 层次结构中的任意点声明任意元素的语言来重写继承。

如果您计划从应用中的服务器显示本地化数据,请谨记语言对齐。如果显示的内容的语言与正在运行的应用的 CurrentUICulture 中指定的语言不同,您可能会遇到此处描述的语言问题。通过了解要显示的数据的语言(通过应用逻辑或服务器元数据)并且显式地设置要匹配的显示元素的语言特性,您可以保留应用的语言对齐方式。

语言对齐也是用户输入要考虑的问题。尽管将元素的 Language 特性设置为内容的显示语言是非常理想的做法,但是请记住当前使用的键盘语言在应用模型中不可用。

如果 Windows Phone 不支持您需要在应用中使用的字体,您可以将该字体嵌入到您的应用中。

警告说明警告:

“Windows Phone 中受支持的 UI 字体”列表中列出的东亚语言字体对应用是不可再发行的。

Windows Phone 使用 Unicode 表示字符。我们建议您开发包含 Unicode 编码的应用以确保您的应用可以在全球环境中运行。您可以使用 Encoding 类将编码从一种 Unicode 类型转换为另一种 Unicode 类型,例如,从 UTF-8 转换为 UTF-16。

不包含编码的字符

不包含编码信息的非 Unicode 字符将根据手机上的“系统区域设置”设置显示。“系统区域设置”设置由用户设置,表示手机上的默认字符集和字体。

日元和韩元字符 - ¥和 ₩

“Reverse Solidus”Unicode 字符 (U+005C) 在日语显示语言中显示为“日元”字符,在朝鲜语显示语言中显示为“韩元”字符。但是,因为在其他显示语言中该字符将以反斜杠显示,所以请使用“Yen Sign”Unicode 字符 (U+00A5) 和“Won Sign”Unicode 字符 (U+20A9) 代替此字符以确保它们始终正确显示。

WebBrowser 控件

在使用 WebBrowser 控件显示内容或设计要在 Windows Phone 上显示的网站时,请确保在您的 HTML 中包含正确的编码元数据信息。

在以下代码示例中,因为没有将字符串进行正确编码,所以在名为 BrowserControl 的 WebBrowser实例中许多字符没有正确显示。

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

而是包含 HTML 内容中的编码信息,如以下代码示例所示。

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

下表列出了 Windows Phone 设备上所有受支持的 UI 字体。每种字体对特定设备是否可用取决于该设备上包含哪些显示语言。

拉丁语、西里尔文和基于希腊语的语言

所有拉丁语、西里尔文、希腊语和基于希伯来语的语言的显示语言使用 UI 字体 Segoe WP。所有手机上都包含此字体,所以即使将不同的语言(如日语)设置为显示语言,任何拉丁语、西里尔文、希腊语和基于希伯来语的文本仍以 Segoe WP UI 字体显示。

Windows Phone 8 UI 字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Segoe WP

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

DengXian

中文(简体)

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Mhei

中文(繁体)

green check mark conditional check mark conditional check mark conditional check mark red x red x

Yu Gothic

日语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft NeoGothic

朝鲜语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Segoe UI

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Nirmala UI

印度语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Leelawadee

泰语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Segoe UI 符号

支持各种 Unicode 符号,包括添加 Unicode 6.0 中的表情符号。

green check mark conditional check mark conditional check mark conditional check mark red x red x

Windows Phone OS 7.1 UI 字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Segoe WP

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark green check mark green check mark

Segoe WP SemiLight

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Segoe WP SemiBold

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

DengXian

中文(简体)

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Mhei

中文(繁体)

green check mark conditional check mark conditional check mark conditional check mark red x red x

Yu Gothic

日语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft NeoGothic

朝鲜语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Segoe UI

拉丁语、西里尔文、希腊语和基于希伯来语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

中文(简体)

警告说明警告:
此字体仅包含在提供简体中文显示语言的 Windows Phone OS 7.1 设备上。
green check mark conditional check mark conditional check mark conditional check mark red x red x

Segoe UI 符号

支持各种 Unicode 符号,包括添加 Unicode 6.0 中的表情符号。

green check mark conditional check mark conditional check mark conditional check mark red x red x

说明注意:

针对日语本地化您的 Windows Phone 应用时,请使用 Yu Gothic UI 字体。

下表列出了在 Windows Phone 上所有受支持的文本显示字体。

Windows Phone 8 文本显示字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

非洲语

Nko、Ethiopic、Tifinagh、Vai 和 Osmanya

green check mark conditional check mark conditional check mark conditional check mark red x red x

Estrangelo Edessa

叙利亚语

green check mark conditional check mark conditional check mark conditional check mark red x red x

美属土著语

切罗基语和

green check mark conditional check mark conditional check mark conditional check mark red x red x

Khmer UI

高棉文

green check mark conditional check mark conditional check mark conditional check mark red x red x

Lao UI

老挝语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Himalaya

藏语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft New Tai Lue

新傣文

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Tai Le

德宏傣文

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Uighur

维吾尔语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Microsoft Yi Baiti

Yi

green check mark conditional check mark conditional check mark conditional check mark red x red x

Mongolian Baiti

蒙古语

green check mark conditional check mark conditional check mark conditional check mark green check mark green check mark

MV Boli

塔纳文

green check mark conditional check mark conditional check mark conditional check mark red x red x

PhagsPa

Phags-pa

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

中文(简体)

green check mark conditional check mark conditional check mark conditional check mark red x red x

Urdu Typesetting

阿拉伯语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Windows Phone OS 7.1 文本显示字体

说明注意:

下面的 Windows Phone OS 7.1 文本显示在 Windows Phone 8 中不可用的字体。

字体名称

语言

常规

粗体

斜体

倾斜加粗

Microsoft YaHei

繁体中文、简体中文

green check mark conditional check mark conditional check mark conditional check mark red x red x

Meiryo UI

日语

green check mark conditional check mark conditional check mark conditional check mark red x red x

Malgun Gothic

朝鲜语

green check mark conditional check mark conditional check mark conditional check mark red x red x

下表列出了 Windows Phone 上所有受支持的额外字体。

Windows Phone 8 额外字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Arial

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x green check mark

Calibri

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark green check mark red x

Comic Sans MS

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Courier New

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

格鲁吉亚

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Lucida Sans Unicode

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Times New Roman

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Trebuchet MS

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Windows Phone OS 7.1 额外字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Arial

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x green check mark

Calibri

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Comic Sans MS

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Courier New

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

格鲁吉亚

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Lucida Sans Unicode

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Times New Roman

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Trebuchet MS

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

宋体

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

下表列出了在 Windows Phone 上所有受支持的数学和符号字体。

Windows Phone 8 数学和符号字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Cambria / Cambria Math

拉丁语、西里尔文和基于希腊语的语言

green check mark conditional check mark conditional check mark conditional check mark red x red x

Wingdings

符号

green check mark conditional check mark conditional check mark conditional check mark red x red x

Webdings

符号

green check mark conditional check mark conditional check mark conditional check mark red x red x

Windows Phone OS 7.1 符号字体

字体名称

语言

常规

粗体

斜体

倾斜加粗

Wingdings

符号

green check mark conditional check mark conditional check mark conditional check mark red x red x

Webdings

符号

green check mark conditional check mark conditional check mark conditional check mark red x red x

上面表格中使用的符号的解释如下:

符号

说明

green check mark

是否支持

conditional check mark

通过算法加粗或斜体来实现

red x

不受支持

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值