IE8随机呈现字体的权重 [英] IE8 Renders font weights randomly
问题描述
在IE8的网页上,我使用font-face在CSS中有4个自定义字体,每个字体中的两个字体以粗体和正常的权重到同一个家庭。
On a webpage in IE8 I have 4 custom fonts in CSS using font-face, two of each font go to the same family for bold and normal weights.
我发现IE8随机呈现非粗体为粗体,有时反之亦然。
I have found that IE8 randomly renders the non bold as bold and sometimes vice-versa. If I sit at the page pressing refresh each time it loads the text changes, seemingly randomly.
我甚至尝试让JavaScript在加载所有内容之后设置元素的字体,
I even tried having javascript set the fonts for elements only after everything is loaded - and it still occurs.
任何人都知道发生了什么。
Any one know whats going on?
推荐答案
p>在IE8中使用单个字体的多个权重和样式时,我遇到过相同的问题。 Typekit有一篇文章解释了IE8及以下版本中的此错误:使用多个权重和样式
I've had the same issue when using multiple weights and styles of a single font in IE8. Typekit has an article that explains this bug in IE8 and below: Using multiple weights and styles
根据他们:
Internet Explorer 6, 7,& 8每个家庭最多加载四个权重。此外,使用两个紧密相关的权重(例如,400和500)可能导致正确加载一个权重。
"Internet Explorer 6, 7, & 8 load a maximum of four weights per family. Additionally, using two closely-related weights (e.g., 400 and 500) may result in only one weight loading correctly."
使用变体特定似乎是解决这个问题的方法。像这样(来自Myfonts.com网络字体套件的片段):
Using variation specific seems to be the way to solve this. Like so (snippet from a Myfonts.com web font kit):
@font-face {
font-family: 'AvenirNextLTPro-DemiIt'; /* Demibold Italic */
font-style: italic;
font-weight: 600;
src: url('webfonts/25A826_1_0.eot');
src: url('webfonts/25A826_1_0.eot?#iefix') format('embedded-opentype'),url('webfonts/25A826_1_0.woff') format('woff'),url('webfonts/25A826_1_0.ttf') format('truetype');
}
@font-face {
font-family: 'AvenirNextLTPro-BoldIt'; /* Bold Italic */
font-style: italic;
font-weight: 700;
src: url('webfonts/25A826_6_0.eot');
src: url('webfonts/25A826_6_0.eot?#iefix') format('embedded-opentype'),url('webfonts/25A826_6_0.woff') format('woff'),url('webfonts/25A826_6_0.ttf') format('truetype');
}
.someclass {
font-family: 'AvenirNextLTPro-DemiIt'; /* Demibold Italic */
font-style: italic;
font-weight: 600;
}
.otherclass {
font-family: 'AvenirNextLTPro-BoldIt'; /* Bold Italic */
font-style: italic;
font-weight: 700;
}
这篇关于IE8随机呈现字体的权重的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!