我怎样才能改变/套默认fontFamily中在Windows 8手机 [英] how can i change/set default fontfamily in windows phone 8

查看:158
本文介绍了我怎样才能改变/套默认fontFamily中在Windows 8手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要更改默认字体为我的应用程序自定义字体。我可以改变它的一个组成部分,但有什么办法,我可以设置任何fontFamily中作为默认值将所有组件?


解决方案

最近我不得不做同样的事情,这是我的方法:




  • 的App.xaml 添加您字体作为一种资源,像




 < Application.Resources> 
<的FontFamily X:键=CustomFontHelvetica> / MyApp的;组件/资源/ Helvetica.ttf#黑体
< /&的FontFamily GT;
< /Application.Resources>




您应该设置的属性生成操作资源复制到输出目录复制跳投复制如果新




  • ,并在页面变化的FontFamily ={StaticResource的PhoneFontFamilyNormal}的FontFamily ={StaticResource的CustomFontHelvetica}



只是不要在你的控制覆盖字体家族财产


I want to change the default font for my app to a custom font. I am able to change it for a component, but is there any way i can set any fontfamily as a default to all the components?

解决方案

Recently i had to do the same thing, this is my approach:

  • In App.xaml add you font as a resource, like

<Application.Resources>
<FontFamily x:Key="CustomFontHelvetica">/MyApp;component/Resource/Helvetica.ttf#Helvetica
</FontFamily>
</Application.Resources>

you should set the properties Build Action to Resource and Copy to Output directory to copy aways or copy if newer

  • and in your page change FontFamily="{StaticResource PhoneFontFamilyNormal}" to FontFamily="{StaticResource CustomFontHelvetica}"

Just do not overwrite font family property in you controls

这篇关于我怎样才能改变/套默认fontFamily中在Windows 8手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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