【问题标题】:font face not working for IE8 ?? getting @font-face encountered unknown error.?字体不适用于 IE8 ??获取@font-face 遇到未知错误。?
【发布时间】:2014-06-06 15:26:45
【问题描述】:

我正在使用字体来包含一个名为 razing 的自定义字体。该字体在 IE8 中不起作用,但在 IE9+ 和其他浏览器上运行良好。我在 IE8 浏览器中检查了控制台,发现“@font-face 遇到未知错误。” 我尝试使用 svg 和 ?#iefix 之类的修复程序,但它不起作用.请您提供一个健康的解决方案来克服这个问题,谢谢!

 <style>
  @font-face {
  font-family: Razing;
  src: url(Fonts/Razing/razing.eot);
  src: url(Fonts/Razing/razing.eot?#iefix) ,
 url(Fonts/Razing/razing.ttf),
 url(Fonts/Razing/razing.woff),
 url(Fonts/Razing/razing.svg) format('svg');

  }
.ABC{ font-family:Razing;font-size:20px;  }
</style>

 <p class="ABC"></p>

【问题讨论】:

标签: html css fonts internet-explorer-8 font-face


【解决方案1】:

在 #iefix 行的末尾尝试 format('embedded-opentype')。例如

src: url(Fonts/Razing/razing.eot?#iefix) format('embedded-opentype'),

【讨论】:

    【解决方案2】:

    编辑您的字体文件,为 Fontname、Family name 和 Name 定义相同的名称并导出您的 TTF。您可以使用FontForge 应用程序。

    然后再次将其转换为网络(EOT、WOFF)。

    Read

    通过下载 TTF 字体版本并将其转换为网络来使其工作。

    CSS

    @font-face {
        font-family: 'Razing';
        src: url('fonts/Razing.eot');
        src: url('fonts/Razing.eot?iefix') format('opentype'),
             url('fonts/Razing.woff') format('woff'),
             url('fonts/Razing.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-05
      • 1970-01-01
      • 2012-06-22
      • 2013-03-02
      • 1970-01-01
      • 1970-01-01
      • 2014-07-07
      • 2019-08-06
      相关资源
      最近更新 更多