internet-explorer - 在 IE 中渲染 Open Sans 字体

标签 internet-explorer fonts

我在 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/

相关文章:

c# - 如何在 Internet Explorer 或 .NET Web 浏览器控件中阻止 iframe

c# - 如何获取字体文件名?

Python ImageFont 和 ImageDraw 检查字符支持的字体

css - Chrome 中的连字 : Only displaying when adding other characters

html - Internet Explorer 9 无法正确显示文本

internet-explorer - IE11 中的 "Outline elements"函数在哪里?

html - 我怎样才能为 IE 提供特殊的 CSS?

javascript - ie中的jquery标题选择器错误

html - IE10 字体适用于实时站点,但不适用于开发站点

.net - 在 .NET 应用程序中嵌入/部署自定义字体