自定义字体,EOT格式无法使用

4

我无法让自定义字体在IE7和IE8中正常工作:

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

在IE9,Firefox和Chrome中可以正常工作...

对于Firefox和Chrome,字体为TTF格式 而对于IE,则为EOT格式

然而,它只能在IE9中正常工作 :(

3个回答

4
尝试使用这种 CSS 格式而不是之前的格式:
@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');
}

这是我使用的方式(除了otf,woff和svg之外)。我从未遇到IE无法呈现字体的情况。

我需要从 @adedoy 的答案中获取 IE9 部分才能使这个工作起来。 - 8bitjunkie

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 */
    }

0

您需要发送正确的EOT文件MIME类型。在Apache中,将以下内容添加到您的.htaccess文件中应该可以解决问题。

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接