我在 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;
}
最佳答案
似乎 IE 无法使用 .ttf 字体文件,您可以尝试使用转换器将 .ttf 转换为 .eot(您可以在谷歌上搜索“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 */}
我已经试过了,它正在工作。祝你好运!!!
关于internet-explorer - 在 IE 中渲染 Open Sans 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19288850/