font face not working for IE8 ?? getting @font-face encountered unknown error.?

自闭症网瘾萝莉.ら 提交于 2019-12-13 08:10:20

问题


I am using font face to include a customised font named razing. The font is not working in IE8 but works well on IE9+ and other browsers. I checked the console in IE8 browser and i found " @font-face encountered unknown error." I tried using svg and fixes like ?#iefix but it ain't working. Please can u provide a healthy solution to overcome this, Thanks !!

 <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>

回答1:


Try format('embedded-opentype') at the end of your #iefix line. e.g.

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



回答2:


Edit your font file, define identical names for Fontname, Family name and Name and export your TTF. You can use the FontForge application.

And then again convert it for web (EOT, WOFF).

Read

Make it work by downloading version of the TTF font and converted it for web.

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;
}


来源:https://stackoverflow.com/questions/23216470/font-face-not-working-for-ie8-getting-font-face-encountered-unknown-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!