Xamarin形式 - UWP字体 [英] Xamarin Forms - UWP Fonts
问题描述
如何使用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屋!