To embed external fonts into Windows Phone, it is not difficult. First, you need to have fonts (*.ttf). Then, you add it into your Windows Phone project. Next, at your font properties, copy to output directory to copy if newer. Finally, in FontFamily property of your control. Refer to your font file followed by # then a font name, which contained in your font file.
// For example my font file name is RSU_Regular.ttf, and it is under fonts folder in my project. // Refer to font name "RSU" which contained in RSU_Regular.ttf. <UserControl ... FontFamily="fonts/RSU_Regular.ttf#RSU" ...> ... </UserControl>If you want to change control's font in C# file, you can do it by:
this.FontFamily = new FontFamily("fonts/RSU_Regular.ttf#RSU");
No comments:
Post a Comment