Custom font usage in Windows Phone 8

后端 未结 3 368
旧巷少年郎
旧巷少年郎 2021-01-18 17:35

I have a weird problem with the Windows Phone 8 emulator! I have a small test app where I change the \'page name\' textbox on the mainpage so that it shows using a custom fo

3条回答
  •  走了就别回头了
    2021-01-18 18:17

    First of all, you should save the external ttf into your project(If you want to use external font).

    Then, you can use this:

    FontFamily="Helvetica.ttf#Helvetica"
    
    FontFamily="Cookies.ttf#Cookies"    
    

    When the .ttf font file is in the root folder, works fine in Design and Runtime.

    FontFamily="/FontsTestApp;component/Cookies.ttf#Cookies"    
    

    Same as above.

    FontFamily="/Font/Cookies.ttf#Cookies
    

    When the .ttf font file is in the sub folder "font". Works fine in Design and Runtime.

    FontFamily="../Fonts/Cookies.ttf#Cookies";
    

    When the XAML file which uses the font resides in another subfolder. Works fine in Design and Runtime.

    FontFamily="../Fonts/Cookies.ttf#Cookies";  
    

    If the XAML file is in the root folder, the font gets applied only at runtime not at design time.

提交回复
热议问题