custom fonts, eot, not working

无人久伴 提交于 2021-01-27 06:51:54

问题


I cant get my custom fonts to work in IE7 and IE8:

http://i-creative.dk/iJob/

It works fine in IE9, Firefox and Chrome...

For Firefox and Chrome the fonts are in TTF And for IE, it's in EOT

However, it only works in IE9 :(


回答1:


Try this css formatting instead:

@font-face {
    font-family: 'fontName';
    src: url('/path/to/font.eot?') format('eot'), 
         url('/path/to/font.otf') format('otf'), 
         url('/path/to/font.ttf') format('truetype');
}

This is what I use (sans the otf, woff & svg instead). and I have never had any of the IE's not render the font.




回答2:


@font-face {
    font-family: Graublauweb; /*any name for your font*/
    src: url('Graublauweb.eot'); /* IE9 Compatibility Modes */
    src: url('Graublauweb.eot?') format('eot'),  /* IE6-IE8 */
    url('Graublauweb.woff') format('woff'), /* Modern Browsers */
    url('Graublauweb.ttf')  format('truetype'), /* Safari, Android, iOS */
    url('Graublauweb.svg#svgGraublauweb') format('svg'); /* Legacy iOS */
    }



回答3:


You need to send the correct mime type for EOT files. In apache, adding this to your .htaccess file should work.

AddType application/vnd.ms-fontobject eot
AddType font/ttf                      ttf
AddType font/otf                      otf
AddType font/x-woff                   woff


来源:https://stackoverflow.com/questions/5964161/custom-fonts-eot-not-working

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