Answer the question
In order to leave comments, you need to log in
How to add web fonts to my application?
Hello, this is not the first time I am developing my program in WPF, but I have not encountered this problem before. The bottom line is that in order to use fonts from the Internet, it was enough to throw it into the project through the browser. And the font does appear in the selection list, but nothing changes when you select it. With what it can be connected?
Answer the question
In order to leave comments, you need to log in
Look, when you add fonts, be sure to set the Resource property through Visual Studio.
Then add the following lines to your app.xaml file.
<ResourceDictionary>
<FontFamily x:Key="Dongle-Regular">./Data/Fonts/Dongle-Regular.ttf#Dongle</FontFamily>
<FontFamily x:Key="Dongle-Light">./Data/Fonts/Dongle-Light.ttf#Dongle</FontFamily>
<FontFamily x:Key="Dongle-Bold">./Data/Fonts/Dongle-Bold.ttf#Dongle</FontFamily>
</ResourceDictionary>
FontFamily="{StaticResource Dongle-Regular}"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question