Figen Güngör
Figen Güngör

Reputation: 12559

Is there a way to use fontello ttf icons in Windows Phone 8?

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" /> 

enter image description here

enter image description here

Custom Font Runtime

TextBlock t = new TextBlock();
FontFamily ff = new FontFamily("/Fonts/fontello.ttf#fontello");
t.FontFamily = ff;
t.Text = "&#xE821";

Upvotes: 1

Views: 499

Answers (1)

Abhishek
Abhishek

Reputation: 1379

You can specify the Unicode value in this way:

XAML:

<TextBlock x:Name="textBlock" Text="&#xE82E;" FontFamily="fontello.ttf#fontello" /> 

Code behind:

textBlock.FontFamily = new FontFamily("fontello.ttf#fontello");
textBlock.Text = "\uE82E";

Upvotes: 3

Related Questions