Xamarin形式 - UWP字体 [英] Xamarin Forms - UWP Fonts

查看:190
本文介绍了Xamarin形式 - UWP字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天来到这里,又一次谈到同样的问题......我无法找到任何一个帖子或问题,我可以看到,或者回答我得到了。



如何使用UWP工作自定义字体

红色的教程,说实话,我想我知道当小孩知道是***诗!



我试了这么多,但没有任何工作...

 字体=/Assets/Fonts/Roboto-Light.ttf#Roboto Light; 
font = @\Assets\Fonts\Roboto-Light.ttf#Roboto Light;
font =./Assets/Fonts/Roboto-Light.ttf#Roboto Light;
font = @。\Assets\Fonts\Roboto-Light.ttf#Roboto Light;
font =/Fonts/Roboto-Light.ttf#Roboto Light;
font = @\Fonts\Roboto-Light.ttf#Roboto Light;


解决方案

https://en.wikipedia.org/wiki/Font =nofollow>一些字体的重量,例如Light / Bold等,我们不使用完整的字体名称后跟#符号

例如,如果我们需要将 Roboto Light 字体,请使用 Roboto

  /Assets/Fonts/Roboto-Light.ttf#Roboto 

XAML:

 < TextBlock FontFamily =/ Assets / Fonts / Roboto-Light.ttf#RobotoText =This is a test:Roboto Light FontSize:10FontSize =10/> 


I come here today, one more time about the same question... I can't find, in spit of every either post or question I could see, or answer I got about it..

How does work custom fonts with UWP?

I red the tutorial and honestly, I think I know it as a child who knows is *** poem !

I tried so much but nothing work...

font = "/Assets/Fonts/Roboto-Light.ttf#Roboto Light";
font = @"\Assets\Fonts\Roboto-Light.ttf#Roboto Light";
font = "./Assets/Fonts/Roboto-Light.ttf#Roboto Light";
font = @".\Assets\Fonts\Roboto-Light.ttf#Roboto Light";
font = "/Fonts/Roboto-Light.ttf#Roboto Light";
font = @"\Fonts\Roboto-Light.ttf#Roboto Light";

解决方案

One important thing here is, for some weight of font, e.g. Light/Bold etc, we don't use the full font name followed # symbol

For example, if we need to set Roboto Light as Font, use Roboto instead.

/Assets/Fonts/Roboto-Light.ttf#Roboto

XAML:

<TextBlock FontFamily="/Assets/Fonts/Roboto-Light.ttf#Roboto" Text="This is a test: Roboto Light FontSize: 10" FontSize="10" />

这篇关于Xamarin形式 - UWP字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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