2012-10-28 19 views
0

我在網站上有一個很奇怪的問題。font-face在Mac上不顯示

我們最近推出了一款website,它在PC上運行良好。但是,當涉及到Mac瀏覽器根本不顯示任何字體。

我使用font-face來包含特定的字體,並且根據屏幕寬度有兩種不同的樣式表。我嘗試了幾個在這裏找到的選項,但似乎沒有任何工作。我在CSS中使用的最後一種語法是這樣

@font-face { 
    font-family:'ChollaSansGr'; 
    src: url('http://:/')format('IE-No-404'),url('./fonts/ChSaGrRg.ttf') format('truetype'); 
    font-style: normal; 
    font-weight: 700; 
} 

所以我的問題是,如果誰能幫我解決或給予什麼可能是問題的根源建議。

+0

您在Mac上使用哪種瀏覽器? –

+0

你確定這是:''http://:/''? – 2012-10-28 13:32:57

+0

我正在使用Safari。我不確定http://但我正在嘗試。我嘗試了reno提出的解決方案,但safari似乎無法找到建議的字體文件並渲染一個通常的文件。這個問題只在所有瀏覽器上的MAC上,因爲Windows上的Safari瀏覽器完美無缺......問題必須與路徑一致,因爲我在Mac上的Firefox中看到系統也呈現另一種字體樣式,而不是ChollaSans。 – user1780780

回答

4

如果你使用Safari瀏覽器,我發現在網絡上此解決方案:

那麼事實證明我沒有解決這個問題,至少到目前爲止在Mac上。這就是:創造webkits的CSS 使用「和」周圍的URL這似乎托住東西產生

字體松鼠和字體登記他們還 設置所有的權重和樣式正常這似乎也。到發泄 破壞

這裏是由字體松鼠爲 拉託的面的2產生的代碼:

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

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

以下是我改成了實際工作中的Safari和Chrome 和Firefox:

@font-face { 
    font-family: Lato; 
    src: url(../../fonts/Lato-BlackItalic-webfont.eot); 
    src: url(../../fonts/Lato-BlackItalic-webfont.eot?#iefix) format(embedded-opentype), 
     url(../../fonts/Lato-BlackItalic-webfont.woff) format(woff), 
     url(../../fonts/Lato-BlackItalic-webfont.ttf) format(truetype), 
     url(../../fonts/Lato-BlackItalic-webfont.svg#LatoBlackItalic) format(svg); 
    font-weight: 900; 
    font-style: italic; 
} 


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

鏈接是在這裏:http://css-tricks.com/forums/discussion/10797/font-face-not-working-in-only-safari-/p1

希望這有助於。

相關問題