This will load the FontAwesome custom font for use in Windows 8.1 Universal apps:
FontFamily customFont = new FontFamily("ms-appx:///Assets/FontAwesome.otf#FontAwesome");
textBlock.FontFamily = customFont;
textBlock.Text = "\uf164"; // thumbs up!
NB: Set the 'FontAwesome.otf' Properties:
- Build Action: 'Content'
- Copy to Output Directory: 'Do not copy'
Also here is the Data model method I use to return Unicode string for Binding (where this.code is "\uf164"):
public String unicode
{
get
{
String codePoint = this.code.Substring(2); // remove '\u' => "f164";
int unicode = int.Parse(codePoint, System.Globalization.NumberStyles.HexNumber);
String unicodeString = char.ConvertFromUtf32(unicode).ToString();
return unicodeString; // "\uf164"
}
}