Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I've tried a lot with embedding a font in a wpf app in c#. The font's name is 'Roboto'. The filename is roboto.ttf if that's of use. I've made sure it's compiled in the assembly. So how to apply the font in a TextBlock for example?
TextBlock
You can apply your font in an element like this:
<TextBlock FontFamily="./#Roboto" ... />
Or you can specify the font's filename like this;
<TextBlock FontFamily="./roboto.ttf" ... />
You can also specify "./#Roboto Light" for example if you want the light font if it's embedded too.
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.