2013-01-14 68 views
0

我想爲我的網站使用自定義字體,但在Chrome(最新版本)和Opera瀏覽器中顯示錯誤,雖然它在其他瀏覽器上顯示正確(平滑)。我嘗試了幾種不同的字體,在Chrome/Opera上也有相同的結果。自定義字體在Chrome上不正確顯示

我的代碼:

@font-face { 
    font-family: 'mainFont2'; 
    src: url('../fonts/Eurostile.eot'); 
    src: local('☺'), url('../fonts/Eurostile.woff') format('woff'), url('../fonts/Eurostile.ttf') format('truetype'), url('../fonts/Eurostile.svg') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

問題:

enter image description here

回答

2

那OS是多麼的瀏覽器,並呈現font..but嘗試調用.SVG格式在.woff格式之前,它可能會解決這個問題。

@font-face { 
    font-family: 'mainFont2'; 
    src: url('../fonts/Eurostile.eot'); 
    src: local('☺'), 
    url('../fonts/Eurostile.svg') format('svg'), 
    url('../fonts/Eurostile.woff') format('woff'), 
    url('../fonts/Eurostile.ttf') format('truetype'); 
    font-weight: normal; 
    font-style: normal; 
} 
+0

事實上,除去woff和在頂部添加svg修正了這個問題,但是這個字體是1.3mb,所以加載需要幾秒鐘。有沒有辦法預載它? – lonewulf

+1

這應該解決這個問題http://paulirish.com/2009/fighting-the-font-face-fout/ – 2013-01-14 22:34:00

相關問題