@fontface in IE7 (IETEster) not working properly

巧了我就是萌 提交于 2019-12-06 06:03:51

Stay away from IEtester. It's not an accurate simulation of ie's rendering and also scripting engine.

IETester does fail in a lot of places. I have noticed that IE7 on IETester is generally unstable and crashes on me as well. Try using IE collection. If the problem persists I would install a VM running IE7 first and test on that before assuming there is something wrong with the code.

UPDATE Can you try changing the order:

@font-face {
 /* for IE */
 font-family: 'SansumiExtraBoldRegular';
 src: url('../fonts/Sansumi-ExtraBold-webfont.eot');
}

@font-face {
/* for other browsers */
font-family: 'SansumiExtraBoldRegular';
    src: url('../fonts/Sansumi-ExtraBold-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/Sansumi-ExtraBold-webfont.woff') format('woff'),
         url('../fonts/Sansumi-ExtraBold-webfont.ttf') format('truetype'),
         url('../fonts/Sansumi-ExtraBold-webfont.svg#SansumiExtraBoldRegular') format('svg');
}

This might be a bit late, but for anyone who's still running into this problem - like me on a Sunday morning still ripping out my hair with legacy browsers - I've tested the following on IE6 and IE7 in IETester and it works great. Actually, it's really close to what you had Martin:

@font-face
{
    font-family: "example-font-family";
    src: url("./fonts-location/Font.eot");
    src: url("./fonts-location/Font.eot?iefix") format("eot"),
         url("./fonts-location/Font.ttf") format("truetype");
}

Works great in Firefox too! Hope this helps someone!

@font-face web fonts work in IE6/7/8 in the current version of IETester (example).

The issue is that IE6/7/8 .eot parser is buggy and doesn't work unless the font follows some special rules.

For example, the font name must begin with or be equal to the family name. You can use Fontforge to edit your font and ttf2eot to re-generate the .eot from it or just use the free online webfont generator.

Then you should make sure font-family in the CSS exactly matches the font family name in the .eot.

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