2013-03-06 56 views
0

Iam在ubuntu上做一個網站,並完成UI部分。在Ubuntu的一切工作順利,但當我打開窗戶時,所有的字體都失真了。我試了下面的代碼字體在窗口中看起來扭曲

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

} 

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

} 

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

} 

使用松鼠發電機生成指定的代碼。我嘗試將font-smooth屬性設置爲'always',同時將-webkit-font-smoothing設置爲antialiased,字體權重也指定爲700,而對於粗體則爲900,而不是'normal',但沒有任何效果。

請建議最佳解決方案......

+0

您是否在談論Google Chrome? – 2013-03-06 15:34:44

+0

問題在於所有瀏覽器。 – PRASANTH 2013-03-06 15:36:05

+0

由於這是字體的視覺問題,因此應該包含您遇到的問題的圖片。 – Axel 2013-03-06 15:46:00

回答

0

網頁字體在所有瀏覽器中都不流暢。您可能必須使用-webkit-font-smoothing: antialiased作爲網頁瀏覽器。

您最好使用text-shadow: 0px 0px 1px #GOOD-COLOR-HEREtext-shadow: 0px 0px 1px rgba(COLOR-SETTINGS-HERE)並調整顏色設置和陰影以獲得最佳效果。

0

當問題出現在所有瀏覽器中時,它會彈出問題,您的字體或其他東西有問題嗎? 您是否可以嘗試在Windows中使用另一種自定義字體來查看結果?

雖然解決方案@Madhu Rox提供的是非常先進的。

+0

不是答案。應該作爲評論發佈。 – 2013-03-06 16:22:42