Xamarin表格 - UWP字体

Emi*_*m23 3 fonts xamarin.forms uwp

我今天来到这里,还有一次关于同一个问题...我无法找到,在我发现的任何一个帖子或问题的吐口水中,或者我得到的答案......

如何使用UWP使用自定义字体?

我老了教程,老实说,我想我知道这是一个知道是***诗的孩子!

我尝试了很多,但没有任何工作......

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";
Run Code Online (Sandbox Code Playgroud)

Fra*_*SFT 7

这里一个重要的事情是,对于某些字体重量,例如Light/Bold等,我们不使用#符号后面的完整字体名称

例如,如果我们需要将Roboto Light设置为Font,请改用Roboto.

/Assets/Fonts/Roboto-Light.ttf#Roboto
Run Code Online (Sandbox Code Playgroud)

XAML:

<TextBlock FontFamily="/Assets/Fonts/Roboto-Light.ttf#Roboto" Text="This is a test: Roboto Light FontSize: 10" FontSize="10" />
Run Code Online (Sandbox Code Playgroud)