2014-02-09 98 views
1

我正在處理一些前端項目,並且遇到了字體問題。字體是確定與Firefox,但使用Chrome看起來很醜,就像一個計時新聞羅馬..字體不適用於Chrome

下面是代碼是用來對字體導入我的薩斯項目:

@font-face { 
    font-family: 'aHeadline'; 
    src: local(' Headline'), 
    url('../fonts/headline.woff') format('woff'), 
    url('../fonts/headline.ttf') format('truetype'), 
    url('../fonts/headline.svg') format('svg'); 
    src: url('../fonts/headline.eot') format('embedded-opentype'); 
    font-weight: normal; 
    font-style: normal; 
} 

這裏是一個活演示http://185.13.36.42/T/foo.html

注:該字體來自Font Squirrel webfont generator

+0

http://stackoverflow.com/questions/4051826/font-face-problem-in-chrome – MiKE

+0

我試過'htaccess'尖,但它沒有不工作 – Xavier

+0

也許這可以幫助:http://www.adtrak.co.uk/blog/font-face-chrome-rendering/ – MiKE

回答

1

只是一個小的語法變化。這會爲你工作:

@font-face { 
    font-family: 'headline'; 
    src: url('../fonts/headline.eot'); 
    src: url('../fonts/headline.eot?#iefix') format('embedded-opentype'), 
     url('../fonts/headline.woff') format('woff'), 
     url('../fonts/headline.ttf') format('truetype'), 
     url('../fonts/headline.svg#open_sanslight') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 
+0

它的確如此!你在哪裏找到這個解決方案? – Xavier

+0

我在http://www.fontsquirrel.com/(道具!)fontface生成器提出這個解決方案之後以這種方式使用它。我也測試過它的演示,以防其他事件導致問題。 –