2013-01-20 33 views
2

我正在研究地鐵應用程序:c#和xaml。 該應用程序加載一個HTML文件(存儲在一個目錄中)與其CSS文件的Web視圖。 我想使用自定義字體:我該如何實現這一點?將自定義字體加載到html(webview) - 地鐵應用程序

我已經試過

@font-face { 
    font-family: 'Geeza_Pro'; 
    src: url('ms-appx-web:///Fonts/Geeza_Pro.ttf') format('truetype'); 
    } 


#div_name{ 
    font-size:30px; 
    font-family: "Geeza_Pro"; 
} 

@font-face { 
    font-family: 'Geeza_Pro'; 
    src: url('Fonts/Geeza_Pro.ttf') format('truetype'); 
    } 


#div_name{ 
    font-size:30px; 
    font-family: "Geeza_Pro"; 

,但不起作用!

回答

1
@font-face /* Define New Font */ 
{ 
    font-family: coolfont; /* Assign Font Name */ 
    src: url('fonts/coolfont.ttf'); /* Font File Location */ 
} 

#div_name 
{ 
    font-family: coolfont; 
} 
+0

我已經更新了這個問題。它不加載。 –

+0

仔細檢查您的運行代碼的位置與您的css中指定的src。確保你指向正確的文件夾。 –

+0

我的字體位於/Fonts/font.ttf,我的html和css位於/ Assets/WebView中。我指的是字體嗎? –

相關問題