2013-05-29 24 views
0

我需要使用字體ITC Avant garde Condensed Book和Medium,但我認爲這是非標準字體,所以我如何確保在客戶端瀏覽器的網站上使用此字體?在網頁上使用特定的非標準字體?

+0

可能重複[如何某些非標準字體添加到一個網站嗎?(http://stackoverflow.com/questions/107936/how-to -add-some-non-standard-font-to-a-website) – JJJ

+0

所有你需要知道的關於這個的描述在這裏:http://www.paulirish.com/2009/bulletproof-font-face-implementation-syntax / – Spudley

回答

1

使用

@font-face 
{ 
font-family: myFirstFont; 
src: url('ITC_Avant_garde_Condensed_Book.ttf'), 
    url('ITC_Avant_garde_Condensed_Book.eot'); /* IE9 */ 
} 

閱讀here更多:

記住

@font-face規則在Internet Explorer 9,Firefox的支持, 歌劇,鉻,和Safari。

但是,Internet Explorer 9僅支持.eot類型字體,而Firefox,Chrome,Safari和Opera支持.ttf和.otf類型字體的 。

Internet Explorer 8及更早版本不支持 @ font-face規則。

0

你可以把你的服務器上的字體,然後用它在CSS,如:

@font-face 
{ 
font-family:myFamily; 
src:url('your_source_here/fontName.ttf'), 
    url('your_source_here/fontName.eot'); 
} 

由於IE8不支持@font-face,你應該有一個後備字體。

要獲得不同格式的字體,你可以使用the webfont generator