【问题标题】:Font will not load on any version of Internet Explorer字体不会在任何版本的 Internet Explorer 上加载
【发布时间】:2015-06-17 03:24:59
【问题描述】:

我想在我的网站上为我的徽标添加两种字体,Bebas Neue Regular 和 Bebas Neue Thin。

我使用 font-squirrels 在线字体转换工具转换了我的字体,并在我的 css 中添加了相关的@font-face 代码:

@font-face { 
     font-family: BebasNeueReg; 
     src: url("/fonts/BebasNeueRegular.eot"); 
     src: url("/fonts/BebasNeueRegular.eot?#iefix") format('embedded-opentype'), 
     url("/fonts/BebasNeueRegular.woff2") format('woff2'), 
     url("/fonts/BebasNeueRegular.woff") format('woff'), 
     url("/fonts/BebasNeueRegular.ttf") format('truetype'), 
     url("/fonts/BebasNeueRegular.svg") format('svg'); 
}

如您所见,这是 Bebas Neue Regular 的 @font-face css。出于某种奇怪的原因,Bebas Neue Thin 的 css @font-face 在所有浏览器中都运行良好。这个 css 除了 src 不同之外,完全一样。

@font-face { 
   font-family: BebasNeueThin; 
   src: url("/fonts/BebasNeueThin.eot"); 
   src: url("/fonts/BebasNeueThin.eot?#iefix") format('embedded-opentype'), 
   url("/fonts/BebasNeueThin.woff2") format('woff2'), 
   url("/fonts/BebasNeueThin.woff") format('woff'), 
   url("/fonts/BebasNeueThin.ttf") format('truetype'), 
   url("/fonts/BebasNeueThin.svg") format('svg'); 
}

我尝试了多种方法,例如使用不同的字体转换工具转换字体,交换 url 的顺序。

谁能解释一下?以前有人遇到过同样的问题吗?

提前致谢。

【问题讨论】:

  • 你可以试试其他字体比如arial吗?某些浏览器不会打开错误的字体类型
  • 其他字体工作正常,例如,我使用的是 open sans google api 字体,效果很好。
  • 尝试使用fontsquirrel下载另一个包,看看你的问题是否仍然存在,如果是,这个包包含错误
  • 会做的,谢谢你的建议。

标签: css font-face


【解决方案1】:

我清除了所有内容并重新开始。下载了我想成为项目一部分的字体,然后使用网络字体生成器将它们转换为网络字体。然后我将它们重新添加到项目中,并使用了 zip 文件中的确切 CSS @font-face。这似乎有固定的东西。可能是我最初尝试转换的损坏的开放式字体。

【讨论】:

    猜你喜欢
    • 2014-08-06
    • 1970-01-01
    • 2015-01-01
    • 2015-02-17
    • 2014-12-29
    • 1970-01-01
    • 2013-03-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多