2013-10-01 109 views
0

這裏是on Rails的Ruby的查看代碼字體不正確加載

<style type="text/css"> 
    @font-face { 
     font-family: 'MyFont'; 
     src: url('<%= asset_path('pricedown.ttf') %>'); 
    } 

    h1.my-font { 
     font-family: "MyFont", Verdana, Tahoma; 
     font-size: 50px; 
    } 
</style> 
<h1 class="my-font">the rascals</h1><hr> 

代碼的輸出是這樣的 enter image description here

課程的自定義字體加載,但我沒有得到它像什麼,我通過打開實際的字體文件看到...實際字體文件看起來像這樣.. enter image description here

正如您所看到的,字母'h'和'r'顯示不正確。 是因爲我錯過了CSS部分的東西嗎?

+0

試試這個h1.my-font { font-family:'MyFont',Verdana,Tahoma; font-size:50px; } – falguni

+0

您確定計算機上的字體版本與字體版本完全相同嗎?偶爾web版本會有所不同,以便瀏覽器更易於呈現。 – Coop

+0

@Fags:這沒有用。 –

回答

1

嘗試新鮮的下載和使用的字體。

0
h1.my-font { 
    font-family: "MyFont"; 
    font-size: 50px; 
} 

應該工作

+0

給出相同的結果.....仍然無法正常工作 –