I want to use the awesome font ( http://fortawesome.imtqy.com/Font-Awesome/design.html ) in XAML.
I was able to easily get it to work through direct XAML by creating a font folder and adding a font there, and then in XAML:
<TextBlock FontFamily="Fonts/#FontAwesome"></TextBlock>
Displays the martini icon.
However, when you add it programmatically, it simply displays the invalid character as follows: [] , I tried the following:
XAML:
<TextBlock Name="textBlock"></TextBlock>
WITH#
textBlock.FontFamily = new FontFamily("Fonts/#FontAwesome"); textBlock.Text = HttpUtility.HtmlDecode("");
and the following, which returns a literal string:
textBlock.FontFamily = new FontFamily("Fonts/#FontAwesome"); textBlock.Text = "";
Any ideas?
source share