3

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?

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.