Custom Font in Windows Phone 8

前端 未结 4 1724
遇见更好的自我
遇见更好的自我 2021-01-24 00:44

I tried to add a custom font into my application. I need it for the page title. I copied the font to a folder named \"Fonts\" and changed the build action to Content. In the pro

相关标签:
4条回答
  • 2021-01-24 01:24

    Any Font works in windows 8, but after you add it to your project, right click on the font, choose properties and set "Build action" to "Content". Have a great day!

    0 讨论(0)
  • 2021-01-24 01:26

    You have to add fonts as BlendEmbeddableFonts

    Open your solution in blend, go to the font manager and in "Embedded Fonts", check your custom font.

    Then create a resource called

    <FontFamily           
            x:Key="CustomFont">/Wake Jake;component/Fonts/Fonts.zip#FontName</FontFamily>
    

    and add it as

    FontFamily="{StaticResource CustomFont}"
    

    It will work that way. Let me know if you need further help

    0 讨论(0)
  • 2021-01-24 01:30

    Unfortunately not all fonts work with Windows Phone 8. It tried your font (donwloaded from dafont) in a WP 7.1 project as described here and it works perfectly. Doing the same in a WP 8 project... the font won't load. So, you probably have to pick another font.

    0 讨论(0)
  • 2021-01-24 01:47

    If the font is located in your main WP8 project, you don't need to use the /AppName;component path. Also make sure the Dekers_Bold is actually name of the font, you should maybe try DekersBold or just Dekers:

    FontFamily="/Assets/Fonts/Dekers_Bold.ttf#DekersBold"
    

    If this is not working, try to add your font as resources first:

    <FontFamily x:Key="Dekers">/Assets/Fonts/Dekers_Bold.ttf#DekersBold</FontFamily>
    ...
    <TextBlock Text="page title" Margin="9,-7,0,0" FontFamily="{StaticResource Dekers}"  /> 
    
    0 讨论(0)
提交回复
热议问题