html - 仅 IE9 字体问题(呈现回退字体)

标签 html css internet-explorer fonts internet-explorer-9

该站点在 chrome 和最新版本的 ff 上运行良好。它似乎也能正常工作并在 IE8 上显示正确的字体;但是在 IE9 中它显示的是更粗的字体。

 @font-face{
    font-family: 'effraregular';
    src: url("http://www.xxxx.com.au/assets/effra_std_rg-webfont.eot");
    src: url("http://www.xxxx.com.au/assets/effra_std_rg-webfont.eot?#iefix") format('embedded-opentype'),
    url("http://www.xxxx.com.au/assets/effra_std_rg-webfont.woff") format('woff'),
    url("http://www.xxxx.com.au/assets/effra_std_rg-webfont.ttf") format('truetype'),
    url("http://www.xxxx.com.au/assets/effra_std_rg-webfont.svg#effraregular") format('svg');
    font-weight: normal;
    font-style: normal;
}

@font-face{
    font-family: 'effralight';
    src: url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.eot");
    src: url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.eot?#iefix") format('embedded-opentype'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.woff") format('woff'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.ttf") format('truetype'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.svg#effralight") format('svg');
    font-weight: normal;
    font-style: normal;
}

根据另一个问题,似乎解决方法是将格式从 eot 更改为 embedded-opentype,但是如您所见,这已经完成。

文档中使用的字体系列:

font-family 'effralight','effraregular' 在 IE9 中,它似乎使用后备字体 effraregular(如果我实时编辑 effraregular 以将其删除,它默认为 times new roman 或类似的字体)。

文档类型: <!DOCTYPE html SYSTEM "about:legacy-compat">

最佳答案

尝试放置 meta标记到您的 HTML 中作为一种快速解决方法,这将告诉 IE9模拟 IE8 ,带回原始渲染。或 more information on same

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />在你的部分。

但是有了这个你就得和其他人妥协IE9更好的功能 HTML5CSS3支持。

一般来说,当你告诉IE9将字体呈现为 boldfont-weight 将发生所需的切换的 800900 .

或使用

font-family: 'effralight';
    src: url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.eot");
    src: url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.eot?#iefix") format('embedded-opentype'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.woff") format('woff'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.ttf") format('truetype'),
    url("http://www.xxxx.com.au/images/assetimages/fonts/effra_light-webfont.svg#effralight") format('svg');
font-size: 0.75em;  
font-weight: 700;

即使使用 nomalize.css 同样可以帮助你

关于html - 仅 IE9 字体问题(呈现回退字体),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23332105/

相关文章:

仅 CSS 3D 旋转文本

javascript - IE 问题 - 使用复选框/单选按钮时 jQuery .change() 不会触发回调?

html - CSS 行的最后一个子元素

html - 没有带有简写字体属性的粗体文本

android - Android 移动浏览器和混合应用程序不支持自定义古吉拉特语字体 (GopikaTwo)

css - flexbox 一个元素固定高度,其他填充

php - Laravel - 如何从/存储中获取图像

javascript - 播放前少做一个html5视频缓冲

javascript - Internet Explorer 中的数组长度因尾随逗号而异

javascript - 当页面包含 JavaScript 时如何避免 IE 消息栏?