The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
CustomFont support in Windows Phone Silverlight and Windows 10 RRS feed

  • Question

  • Hi All,

    We are able to use some custom fonts in windows phone silverlight and windows 10. But Few custom fonts are not working. Earlier we had thread regarding this here.

    We thought It has been resolved, but we have not fixed this completely. 

    The identified issue is "Font name is different when generating with properties window & actual font name" and this works on only Windows Runtime apps.

    So, How to consume my custom fonts in windows phone silverlight? How to get Font name in C sharp like property window generated name in Runtime apps?

    Thanks,


    Pallam Madhukar Windows Phone Developer


    Wednesday, November 4, 2015 5:36 AM

All replies

  • Hi Pallam Madhukar,

    To use custom fonts in Windows Phone or UWP, you can like this: 

    a) Add the your custom font (TTF) to your solution and mark it as “Content” in Build Action under Properties. Set “Copy if newer” in Copy to Output Directory option. Usually I add all my custom fonts under Assets/Fonts folder in Visual Studio Solution of my Projects.

    b) You can get real font name by windows font installer under the "Font name"

    c) Use in XAML as atribute: ... FontFamily="/Assets/Fonts/fontname.ttf#Font name" ...

    d) At runtime: Some_XAML_Element.FontFamily = new FontFamily("/Assets/Fonts/fontname.ttf#Font name");

    If this was helpful, tag as an answer!

    Best regards!

    Wednesday, November 4, 2015 12:55 PM
  • Hi Almir Vuk,

    The approach is  not working for all Custom fonts. Please check the details in other thread:  https://social.msdn.microsoft.com/Forums/windows/en-US/063d6656-4a43-4354-8027-65d121b5bcfd/all-truetype-fontttf-files-are-not-working?forum=silverlightwinphone

    Thanks


    Pallam Madhukar Windows Phone Developer

    Thursday, November 5, 2015 10:25 AM