0

I'm having problems during webdevelopment for IE8. The website should support IE8. Font will not shown correctly.

I use the following code:

@font-face {  
  font-family: 'MyFont';
  src: url('./fonts/myfont/eot/Myfont.eot');
  src: url('./fonts/myfont/eot/Myfont.eot?iefix') format('eot'),
   url('./fonts/myfont/woff/Myfont.woff') format('woff'),
   url('fonts/myfont/ttf/Myfont.ttf') format('truetype'),
   url('./fonts/myfont/svg/Myfont.svg#webfont') format('svg');
  font-weight: normal;
  font-style: normal;
}

What can I do that the font will be shown correctly?.

Thx for your help.

1 Answers1

1

Doesn't look like you have formatted it properly

if your linking outside of the tree the you should have ../ not ./.

Also you were missing the trailing from truetype.

And eot should be embedded-opentype

@font-face {  
  font-family: 'MyFont';
  src: url('../fonts/myfont/eot/Myfont.eot');
  src: url('../fonts/myfont/eot/Myfont.eot?iefix') format('embedded-opentype'),
   url('../fonts/myfont/woff/Myfont.woff') format('woff'),
   url('../fonts/myfont/ttf/Myfont.ttf') format('truetype'),
   url('../fonts/myfont/svg/Myfont.svg#webfont') format('svg');
  font-weight: normal;
  font-style: normal;
}
  • depends if the font folder is in the same folder as the css file – Pete Jul 21 '15 at 08:15
  • Most of the answer is okay but why tell OP to change the relative path - if the font is working in other browsers then the path of the fonts must be correct (I only assume it works in other browsers as the question is only about IE8) – Pete Jul 21 '15 at 08:20
  • because he is missing one also ./ is incorrect and IE8 is less forgiving than other browsers. plus there is nothing to state that he has even worked on another browser. –  Jul 21 '15 at 08:23
  • `./` means current directory it's the same as leaving it off altogether – Pete Jul 21 '15 at 08:23
  • / <-- current directory –  Jul 21 '15 at 08:25
  • http://stackoverflow.com/questions/7591240/what-does-dot-slash-refer-to-in-terms-of-an-html-file-path-location – Pete Jul 21 '15 at 08:39
  • It's to early in the morning for this peter. My answer allready states if he s linking outside of the tree he should use ../ –  Jul 21 '15 at 08:46
  • the fonts work in other browsers with this path configuration, but not in IE8. In IE8 will be shown a non configured standard font, if I check the website in IE9 the font will work as wanted – Gandalf the Grey Jul 21 '15 at 10:11
  • have you got a link to your site? –  Jul 21 '15 at 10:29
  • sorry there is no public link, it's an internal project – Gandalf the Grey Jul 21 '15 at 10:56
  • what does the console say in IE8 about fontface? –  Jul 21 '15 at 11:02
  • font not found, by switching to IE9 the font is loaded fine. I know IE8 is not up to date, but the site should support it. – Gandalf the Grey Jul 21 '15 at 11:08
  • I tested the code above, nothing new. Font is not shown. – Gandalf the Grey Jul 21 '15 at 13:35
  • let me think and ill get back to u going to try something out –  Jul 21 '15 at 13:40