2012-01-30 20 views
2

我做了儘可能簡單的例子:在IE6-8當使用多個權重谷歌Web字體,IE6-8混淆

<!DOCTYPE html> 
<html> 
<head> 
    <title>Test</title> 
    <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,800" 
     rel="stylesheet" type="text/css"> 
    <style type="text/css"> 
    h1 { 
     font-family: "Open Sans"; 
     font-weight: 800; 
    } 
    </style> 
</head> 

<body> 
    <h1>Testing h1</h1> 
</body> 

</html> 

眼下,H1標籤將顯示爲其他的東西比300或800 ...看起來像600.如果我刪除800,它將正確顯示爲300.如果我刪除300並保留800,它將正確顯示爲800.其他任何人都可以複製此內容並解釋如何IE瀏覽器正在顯示我甚至沒有插入的字體重量?

回答

4

對不起回答我自己的問題,但我有一個解決方案。

我最終在鏈接標籤中留下了300個重量。對於800,我抓取了從URL引用的內容(@ font-face聲明),將其粘貼到我的CSS文件中,並將字體家族重命名爲Open Sans(Open Sans Bold)以外的內容......將我的h1 font-family轉換爲不同的名稱和BAM,在所有主流瀏覽器中正確格式化字體權重。

此外,您可以下載嵌入google web-font提供的.woff字體,並在FontSquirrel上創建工具包。

2

根據這篇文章在Adobe TypeKit IE6-8有麻煩加載所有不同的字體一些變體組成一個特定的web字體: http://help.typekit.com/customer/portal/articles/6855

值得一提的是,TypeKit和谷歌字體通過字體裝載機有關(見這裏:https://developers.google.com/fonts/docs/webfont_loader)。但是,儘管Adobe TypeKit爲IE字體變體問題提供瞭解決方案,但它似乎並未通過Google字體提供。

TypeKit方法是爲每個字體的重量和樣式顯式聲明一個font-family。

例如

.light { 
    font-family: "proxima-nova-n3", "proxima-nova", sans-serif; 
    font-style: normal; 
    font-weight: 300; 
} 
.thin-italic { 
    font-family: "proxima-nova-i1", "proxima-nova", sans-serif; 
    font-style: italic; 
    font-weight: 100; 
} 

這似乎遵循(1 100 600轉換爲與用於字體樣式字母后綴字體的名(n爲正,i爲斜體)和一個數爲重量,6 )。我試過這個Google字體,但可惜它不起作用。