I want to use a custom otf
font in my Universal Windows Application, but I can't get it to work.
I am currently using this in my xaml
:
<TextBlock
FontSize="16"
Text="Question"
FontFamily="../Assets/Fonts/NeoSansStdMedium.otf#Neo Sans Std Medium"/>
The font is located in Assets/Fonts
, like so:
Project.Windows (Windows 8.1)
> Assets
> Fonts
> NeoSansStdMedium.otf
And Windows Fontviewer shows the font name as:
Neo Sans Std Medium
So what am I doing wrong?
The font name after the # has to match the font name, and in this case apparently the Medium
is not part of the name...
Some more info: I set the .otf
file's properties to Build Action: Content
and Copy to Output Directory: Do not Copy
.
The XAML excerpt now looks like this:
<TextBlock
FontSize="16"
Text="Question"
FontFamily="../Assets/Fonts/NeoSansStdMedium.otf#Neo Sans Std"/>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments