3
votes

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";
1
I think so, I'll give it a try, thank ! :)Emixam23

1 Answers

11
votes

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" />