2012-03-01 57 views
3

我一直在使用自定義字體和@font-face有很多困難。我試圖讓跨瀏覽器,Safari瀏覽器火狐&的最新版本一致的字體(圖示的順序在下面的截圖:跨瀏覽器@ font-face使用

enter image description here

我用下面生成這個:

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

和:

.menu-button a { 
    height:25px; 
    float:left; 
    border-bottom:2px solid white; 
    color:#ccccff; 
    text-decoration:none; 
    padding:8px 21px 0px 20px; 
    text-align:center!IMPORTANT; 
    background-color:#00378f; 
    font-size:18px; 
    font-family:'dineng', Arial; 
    text-shadow:0 0 1px rgba(0,0,0,0.3); 
    } 

我試過的字體重量的所有莊園降低日e重量但沒有影響他們。我沒有使用CSS3下面黑客在Chrome得到它看起來像我的PSD但不會在其他瀏覽器的工作:

text-shadow:0 0 1px rgba(0,0,0,0.3); 

沒有人有任何建議之前,我從窗口跳出去!

請注意,我無法使用字體SQUIRREL!

+0

你可以發佈一個URL,以便我們可以看看你的其他CSS?看起來像正在應用假黑體。與你的font-face語法無關。 – 2012-03-10 02:49:27

+0

@FontSquirrel這是主菜單 - http://www.mediwales.com/v3/ – Rob 2012-03-12 08:49:39

+0

你有沒有嘗試刪除文字陰影樣式?這是我的猜測,爲什麼你有大膽,不一致的渲染... – 2012-03-19 21:03:10

回答

2

試試這樣說:

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

否則,打開你的計算機上的文件.TTF。如果它已經顯示爲粗體,則字體的大小將無法縮小,因爲這是字體的正常外觀。

+0

我試過重新排序,但似乎沒有任何影響。 – Rob 2012-03-08 15:15:45