CSS fonts not loading in IE9

2019-06-25 09:59发布

问题:

I have a problem with @font-face fonts not loading in IE9. IE8 and below works perfect, as do every other browser I've tried. This is my CSS (font squirrel syntax):

@font-face {
 font-family: 'ssmicon';
 src: url('ssmfont3.eot');
 src: url('ssmfont3.eot?#iefix') format('embedded-opentype'),
  url('ssmfont3.woff') format('woff'),
  url('ssmfont.ttf') format('truetype'),
  url('ssmfont.svg#svgssmfont') format('svg');
 font-weight: normal;
 font-style: normal;
}

All glyphs are in the basic latin range (I read somewhere that IE could have an issue otherwise) and at the same server (so no cross domain issue). I have set Access-Control-Allow-Origin to * just in case. Still no success (at least not according to http://netrenderer.com/. Unfortunately, I don't have access to an IE browser at the moment). Here is a page affected: http://xn--ssongsmat-v2a.nu/ssm/Test3

Any other ideas what specific requirements IE9/10 might have when it comes to web fonts?

回答1:

This was a minification issue after all. Seems like IE9 and IE10 are very picky about line breaks being kept in some places, so font-face declarations have to be kept away from all minification.