Reputation: 12559
I need to use ttf for some icons in my Win8 phone project. I did a research but couldn't find any resources. Is there a way to achieve this?
<TextBlock x:Name="textBlock" Text="\uE82E" FontFamily="/fontello.ttf#fontello" />
Custom Font Runtime
TextBlock t = new TextBlock();
FontFamily ff = new FontFamily("/Fonts/fontello.ttf#fontello");
t.FontFamily = ff;
t.Text = "";
Upvotes: 1
Views: 499
Reputation: 1379
You can specify the Unicode value in this way:
XAML:
<TextBlock x:Name="textBlock" Text="" FontFamily="fontello.ttf#fontello" />
Code behind:
textBlock.FontFamily = new FontFamily("fontello.ttf#fontello");
textBlock.Text = "\uE82E";
Upvotes: 3