face Safari font mime type warning

I have a simple html/css layout using a custom font via @font-face:

@font-face {
    font-family: 'Gotham-Medium';
    src: url('../Font/Gotham-Medium.eot');
    src: url('../Font/Gotham-Medium.eot?#iefix') format('embedded-opentype'),
         url('../Font/Gotham-Medium.ttf') format('truetype'),
         url('../Font/Gotham-Medium.svg#Gotham-Medium') format('svg');
    font-weight: normal;
    font-style: normal;
}

All browsers including IE6 load the font correctly - but I get a warning in Safari (5.0.4).

Resource interpreted as font but transferred with MIME type application/octet-stream.

Funny fact is that on Windows/Safari font displays ok (.ttf file) but shows warning, but on Mac/Safari the font displays as transparent/invisible - showing no text at all (.ttf font file does load + warning message also comes up in console).

Any ideas?


When your browser ask web-server for font file the webserver replies with header information and file contents. And it seems that web-server gives .ttf file with mime-type application/octet-stream. Browser can expect some special mime type for font, like application/x-font-ttf You can use AddType application/x-font-ttf .ttf in apache configuration to specify mime type.

Btw, you have 2 src sections in your @font-face. Probably you should combine them into one separating each source with comma.

链接地址: http://www.djcxy.com/p/46998.html

上一篇: 为csv键入错误

下一篇: 面对Safari的字体MIME类型警告