@font-face 适用于 IE8 但不适用于 IE9 [英] @font-face works in IE8 but not IE9

查看:26
本文介绍了@font-face 适用于 IE8 但不适用于 IE9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上所述,我遇到了 @font-face 无法在 IE9 中显示的问题,尽管它在包括 IE8 及更低版本在内的所有其他浏览器中都能正常显示.此外,在我的计算机上本地查看时,IE9 确实显示了字体,只是在完全实时时不显示.

网站是:

bigwavedesign.co.uk/gcc/gcc/

使用的代码是:

 @font-face {font-family: 'LeagueGothicRegular';src: url('league_gothic_0-webfont.eot');src: local('League Gothic Regular'), url('league_gothic_0-webfont.woff') 格式('woff'), url('league_gothic_0-webfont.ttf') 格式('truetype'), url('league_gothic_0-webfont.svg#webfonta36nFpyE') format('svg');font-weight: normal;font-style: normal;}

有人知道为什么会发生这种情况吗?

干杯!

==============================================

编辑

我发现以下网站在 IE9 中显示相同的字体,您知道他是如何做到的吗?

http://iamthomasbishop.com/

解决方案

没有回答,只是确认:我有类似的问题.字体适用于除 IE9 之外的所有其他 IE 版本,均使用 IETester 和原始浏览器.更改文档模式(F12 开发工具)字体时有效.虽然不是我想要的.

更新:通过一些技巧,我设法让它发挥作用.似乎 IE9 正在使用 .woff 版本的字体(我已经排除了)而不是我认为会的 .eot.我使用了 @font-face generator.com" rel="noreferrer">fontsquirrel 获取所有不同的字体变体并将它们包含在我的项目中,使用 笑脸-本地.不必更改我的 .htaccess 文件.现在可以正常工作并且在所有 IE 版本中看起来都一样:

@font-face {字体系列:LucidaFax-bold";src: url("_font/LucidaFax-bold.eot");源代码:本地(☺"),url("_font/LucidaFax-bold.woff") 格式("woff"),url("_font/LucidaFax-bold.ttf") 格式("truetype"),url("_font/LucidaFax-bold.svg#LucidaFax-bold") 格式("svg");}h1 { font-family: "LucidaFax-bold", serif;}

<小时>

(我什至使用 Mark Tarquin" Wilton-Jones 的 text-shadow hack,对 IE 版本应用与浏览器世界其他部分相同的外观.老派?看起来很棒!值得吗?嗯,学到了很多东西. ;)

As described above, I have issues with @font-face not displaying in IE9 although it displays fine in every other browser including IE8 and under. Additionally, when viewing locally on my computer, IE9 does display the font, just not when fully live.

The site is:

bigwavedesign.co.uk/gcc/gcc/

The code used is:

    @font-face {
                font-family: 'LeagueGothicRegular';
                src: url('league_gothic_0-webfont.eot');
                src: local('League Gothic Regular'), url('league_gothic_0-webfont.woff') format('woff'), url('league_gothic_0-webfont.ttf') format('truetype'), url('league_gothic_0-webfont.svg#webfonta36nFpyE') format('svg');font-weight: normal;font-style: normal;
}

Anyone any ideas why this might be occurring?

Cheers!

=============================================

EDIT

I have found the following site that displays the same font ok in IE9, anyine any ideas how he did that?

http://iamthomasbishop.com/

解决方案

No answer, just confirmation: I have a similar kind of problem. Font works in all other IE versions except IE9, both using IETester and original browser. When changing Document Mode (F12 dev tools) font works. Not how I'd like it though.

Update: With some trickery I managed to get it working. Seems like IE9 is using the .woff version of the font (which I had excluded) over the .eot that I thought it would. I used the @font-face generator from fontsquirrel to get all the different font variations and included them in my project, using the smileyface-local. Did not have to alter my .htaccess file. Now works fine and looks the same in all IE versions:

@font-face {
  font-family: "LucidaFax-bold";
  src: url("_font/LucidaFax-bold.eot");
  src: local("☺"),
  url("_font/LucidaFax-bold.woff") format("woff"),
  url("_font/LucidaFax-bold.ttf") format("truetype"),
  url("_font/LucidaFax-bold.svg#LucidaFax-bold") format("svg");
  }

h1 { font-family: "LucidaFax-bold", serif;}


(I even got mad fresh using Mark "Tarquin" Wilton-Jones' text-shadow hack, applying same look to IE versions as rest of the browser world. Old school? Looks great! Was it worth it? Well, learned a lot. ;)

这篇关于@font-face 适用于 IE8 但不适用于 IE9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆