1
votes

I want to change textblock font to which in my computers font.

FontFamily="/Assets/Fonts/scriptbl.ttf#Script MT Bold"

I use that code, but still font doesn't change. I can not use Blend 2013 to manage fonts. Get this error:

this control is disabled because the blend sdk could not be found.

But I use Blend and Visual Studio 2013. How can I change font?

Edit:

In Windows Phone 8 project, I can manage fonts, but in Windows Phone 8.1 can't do that. Does Blend is incompatible with windows phone 8.1?

1
Font doesn't installed on WP emulator. This code installs font on phone.Metehan Toksoy

1 Answers

0
votes

You can change the font family for a TextBlock in the XAML with this code:

<TextBlock x:Name="txtTest" Grid.Row="3" Text="Text" FontSize="20" FontFamily="/Assets/Fonts/scriptbl.ttf#Script MT Bold"/>

Or in the Code Behind like this:

txtTest.FontFamily = new FontFamily("ms-appx:///Assets/Fonts/scriptbl.ttf#Script MT Bold");

If you're adding an external Font file to the project, make sure you set the 'Copy to Output Directory' property to 'Copy if newer'