2012-09-13 37 views
2

我有一段時間沒有問題的使用font-face的項目。 今天我檢查和字體面對火狐v14和v15不工作,也可以不工作在v12 +作爲在這個線程的情況:http://css-tricks.com/forums/discussion/17337/font-face-problem-with-firefox-v-12/p1 我的問題是完全一樣的在前面的線程。字體在Firefox上不起作用。在其他人身上運作良好

總結。 我使用的字型加載網頁字體是這樣的:

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

然後

#bea .bea { 
    font-family: 'TradeGothicLTStdCnBold'; 
    font-size: 14px; 
} 

的字體是根據螢火蟲正確加載。 它適用於safari,chrome,IE和某些firefoxs。 我試過6個firefox(v13-15),它在其中的一些而不是其他的。我無法確定任何理由。

我也在尋找Firefox的配置值 gfx.font_rendering.cleartype.always_use_for_content; 我注意到在我測試的所有firefox中都設置爲false,即使是正常工作的。

活生生的例子: http://comoquierascolacao.com/jovenestalentos/

應該怎麼看: http://postimage.org/image/n2r9fxdsv/how it should look

總結: - 的路由工作。 - 路由處於相同的域中,沒有跨域問題。 - 它可以在一些Firefox中使用,並且不會在別人使用(沒有理由我可以弄清楚)。 - 之前它可以在我自己的Firefox中工作,也許在v12之前。

謝謝大家,任何幫助將不勝感激,因爲這是讓我瘋狂。

+0

您是否嘗試過Google Web字體?它們提供了更好的跨瀏覽器支持。也許你可以從他們的源代碼中獲得靈感。 – Raptor

+0

是的,我做到了。不幸的是,我的客戶想要的是字體而不是另一種。每當他們讓我使用谷歌網頁字體。謝謝。 –

回答

2

好了,我的錯。畢竟這是一個跨域問題。 即使在訪問時從www.domain...加載的字體http://domain... 將每個人都重定向到www.domain應該可以解決問題,從現在開始我認爲這將是一個很好的做法。 另一個解決方案是使用相對路徑加載字體。

1

JavaScript控制檯(Herramientas-> Desarrollador基於web> Consola德errores)顯示幾個錯誤:

Fecha y hora: 13/09/2012 9:41:37 
Advertencia: downloadable font: no supported format found (font-family: "TradeGothicLTStdCnBold" style:normal weight:normal stretch:normal src index:4) 
source: (end of source list) 
Archivo de origen: http://www.comoquierascolacao.com/jovenestalentos//style/style.css?v=1 
Línea: 0 
Código fuente: 
@font-face { font-family: "TradeGothicLTStdCnBold"; font-style: normal; font-weight: normal; src: url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix") format("embedded-opentype"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff") format("woff"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf") format("truetype"), url("/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold") format("svg"); } 
+0

謝謝阿爾瓦羅。我沒有在控制檯中重現你的錯誤(相信我,是我看起來的第一件事),但是看到我正在加載錯誤的樣式(..jovenestalentos // style ...)。 這讓我看起來更接近網址。 www.comoquierasc ...作品和 http://www.comoquierasc ...不。 畢竟這是一個跨域問題。 對不起! 並感謝所有。 –

+1

如果您在檢查Firebug的控制檯時發現它並不總是顯示所有的錯誤信息。內置控制檯更可靠。 –

+0

我是,我會牢記在心。謝謝。 –

1

我有相同的問題關於FF不正確顯示font-face。 下面是誰可能有此問題的解決方法:

嘗試在塊的末尾聲明「eot」字體。像:

@font-face { 
font-family: 'TradeGothicLTStdCnBold'; 
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.woff') format('woff'), 
    url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.ttf') format('truetype'), 
    url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.svg#TradeGothicLTStdCnBold') format('svg'); 
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot'); 
src: url('/jovenestalentos/fonts/tradegothicltstd-bdcn20-webfont.eot?#iefix') format('embedded-opentype'); 
font-weight: normal; 
font-style: normal; 
1

我的解決方案:在域名與www。工作一切正常,但沒有www。 FF問題。 所以我使用重定向到www。中。httaccess:

RewriteEngine on 
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] 
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] 

它的工作原理!謝謝Hanoc

相關問題