0

我的 Windows phone 8 应用程序应该可以使用英语和阿拉伯语两种语言。我已经在我的应用程序中嵌入了自定义字体并将内容类型设置为始终复制。嵌入字体是nazli.ttf

默认情况下,应用程序的语言是英语,默认字体系列Segoe WP。每当用户将应用程序的语言更改为阿拉伯语时,我都想将字体系列更改为嵌入字体,即nazli.ttf

if (Constants.selectedLanguage.Equals("English"))
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");
            this.FlowDirection = FlowDirection.LeftToRight;

            //Setting the Default Font Family for English
            title.FontFamily = new FontFamily("Segoe WP");
        }
        else
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ar");
            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ar");
            this.FlowDirection = FlowDirection.RightToLeft;

            //Have to set the embed Font Family.
            title.FontFamily = //How should i mention the embed font here
        }

谢谢。

4

1 回答 1

2

基于此博客条目,我将其调整为从后面的代码中工作:

http://www.jeffblankenburg.com/2010/10/24/31-days-of-windows-phone-day-24-embedding-fonts/

现在我在 Assets/Fonts 中有这个字体,传入路径和名称的语法与博客文章中描述的相同。

title.FontFamily = new FontFamily("Assets/Fonts/CFLifeIsADream-Regular.ttf#CF Life Is A Dream");

高温高压

于 2013-07-17T05:47:12.383 回答