如何将自定义字体应用于 Web 浏览器内容 WP7 [英] how to apply custom font to web browser content WP7

查看:24
本文介绍了如何将自定义字体应用于 Web 浏览器内容 WP7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在开发用于在 Windows 手机中学习 webBrowser 概念的简单应用.我的目标是在我的 WP7 中以泰卢固语(印度语)显示内容.该 Web 应用程序仅显示泰卢固语内容

Am developing simple app for learning webBrowser concept in Windows phone. My aim is to display the content in Telugu(Indian language) in my WP7. that web application is displaying Telugu content only

我的 MainPage.xaml.cs 代码是:

my MainPage.xaml.cs code is :

private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
    {
        webBrowser1.Navigate(new Uri("http://www.eenadu.net", UriKind.Absolute));
    }

在 MainPage.xaml 文件中

in MainPage.xaml file

<phone:WebBrowser HorizontalAlignment="Left" Margin="0,92,0,0" Name="webBrowser1"
 VerticalAlignment="Top" Height="575" Width="468" FontFamily="Fonts/eenadu.ttf#Eenadu"  />

并且我已将该 .ttf 文件包含在我的 Fonts 文件夹下的项目中,并分配了 Build Action = 'Content'

and i have included that .ttf file in my project under Fonts folder and assigned Build Action = 'Content'

我可以调用 URL,但它显示不可读的字符.

Am able to call the URL but it displaying unreadable characters.

是否有其他方法可以将自定义字体应用于 Web 浏览器控件?

is there any other way to apply custom font to web browser control?

提前致谢

推荐答案

Windows phone 支持 Web 字体.但是,它们不能嵌入到 XAP 中.建议的解决方法是将字体托管在远程服务器上,并可能使用 AppCache 将字体文件保存在设备本地.

Windows phone supports web fonts. However, they cannot be embedded in the XAP. Suggested workaround is to host the fonts on a remote server and perhaps use AppCache to keep the font files locally on the device.

这篇关于如何将自定义字体应用于 Web 浏览器内容 WP7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆