2012-02-14 93 views
3

我想此代碼爲@fontface一個阿拉伯字體:CSS3 @fontface是無法與Chrome 17和Firefox工作10

@font-face { 
font-family: 'MothnnaFont'; 
src: url('fonts/mothnna.eot'); /* IE9 Compat Modes */ 
src: url('fonts/mothnna.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ 
    url('fonts/mothnna.woff') format('woff'), /* Modern Browsers */ 
    url('fonts/mothnna.ttf') format('truetype'), /* Safari, Android, iOS */ 
    url('fonts/mothnna.svg#svgMothnnaFont') format('svg'); /* Legacy iOS */ 
} 

我使用演示評爲一類的字體:

.demo 
{ 
    font-family:'MothnnaFont',Sans-Serif; 
    width:800px; 
    margin:10px auto; 
    text-align:center; 
    border:1px solid #666; 
    padding:10px; 
    direction: rtl; 
} 

此代碼正在即,但它不工作在Firefox 10或Chrome 17

這裏是一個演示http://tmr.hyperphp.com/font/demo.html

下面是字體應該怎麼看起來像

enter image description here

所以任何人都可以幫我做這個字體出現跨所有的瀏覽器?

解決:剛剛下載的字體,並再次轉換它和它的所有工作現在 謝謝大家幫助

+0

也許使用兩個'src:'?嘗試','而不是'; src:'。 – 0b10011 2012-02-14 20:37:25

+0

試過但沒有工作 – 2012-02-15 11:06:16

+0

你確定路徑正確嗎?其他一切看起來都是正確的。 – 2012-02-15 13:27:38

回答

1

嵌入網頁字體這個語法是不是刀槍不入了。 嘗試使用Fontspring語法來代替:

@font-face { 
    font-family: 'MothnnaFont'; 
    src: url('fonts/mothnna.eot?#iefix') format('embedded-opentype'), 
     url('fonts/mothnna.woff') format('woff'), 
     url('fonts/mothnna.ttf') format('truetype'), 
     url('fonts/mothnna.svg#svgMothnnaFont') format('svg'); 
} 

這只是「SRC」 -attribute需要修復的第一雙的外觀。

這將解決您的問題。請參閱source。順便說一下,fontsquirrel也使用這個語法作爲默認值。

相關問題