【问题标题】:Rendering Open Sans font in IE在 IE 中渲染 Open Sans 字体
【发布时间】:2013-10-17 19:19:03
【问题描述】:
我在 IE10 中渲染 Open Sans 字体时遇到问题。字体在 Chrome 和 Firefox 中正确呈现。在 IE 中,文本默认呈现字体。我从 Google Fonts (http://www.google.com/fonts/specimen/Open+Sans) 下载了字体。这是 CSS 代码:
@font-face {
font-family: 'Open Sans';
src: url('fonts/OpenSans-Regular.ttf');
font-weight: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('fonts/OpenSans-Bold.ttf');
font-weight: bold;
}
【问题讨论】:
标签:
internet-explorer
fonts
【解决方案1】:
似乎 IE 无法使用 .ttf 字体文件,您可以尝试使用转换器将 .ttf 转换为 .eot(您可以在 google 上搜索“converter .ttf to .eot”),将其上传到您的字体文件夹,然后尝试使用这样的东西:
@font-face {
font-family: OpenSans-Bold;
src: url('fonts/OpenSans-Bold.eot'); /* IE */
src: local("OpenSans-Bold"), url('fonts/OpenSans-Bold.ttf') format("truetype"); /* non-IE */}
@font-face {
font-family: OpenSans-Regular;
src: url('fonts/OpenSans-Regular.eot'); /* IE */
src: local("OpenSans-Regular;"), url('fonts/OpenSans-Regular.ttf') format("truetype"); /* non-IE */}
我已经尝试过了,它正在工作。祝你好运!!!