Google警告:资源解释为字体,但使用MIME类型应用程序/八位字节流传输 [英] Google warning: Resource interpreted as Font but transferred with MIME type application/octet-stream

查看:261
本文介绍了Google警告:资源解释为字体,但使用MIME类型应用程序/八位字节流传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google中针对我的font-face发出警告:



资源解释为字体,但使用MIME类型应用程序/ octet-stream: ../ Content / Fonts / iconFont.ttf。



即使我有此警告,但我宁愿避免此警告。



这是我的声明:

  @ font-face {
font-family:'iconFont';
src:url('../ Fonts / iconFont.eot?#iefix')format('embedded-opentype'),
url('../ Fonts / iconFont.svg#iconFont') format('image / svg + xml'),
url('../ Fonts / iconFont.woff')format('font / x-woff'),
url('../ Fonts /iconFont.ttf')format('truetype');
font-weight:normal;
font-style:normal;
}



我已经搜索了其他帖子,但没有运气到目前为止。



请注意,我的服务器是Microsoft的IIS。



任何想法如何避免此警告?



感谢。 /zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings/\">http://zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings /



使用以下web.config设置:

 < system.webServer> 
< staticContent>
< mimeMap fileExtension =。woffmimeType =application / font-woff/>
< / staticContent>
< /system.webServer>


I have a warning in Google for my font-face:

Resource interpreted as Font but transferred with MIME type application/octet-stream: ".../Content/Fonts/iconFont.ttf".

It works even if I have this warning but I prefer avoid this warning.

Here is my declaration:

@font-face {
  font-family: 'iconFont';
     src: url('../Fonts/iconFont.eot?#iefix') format('embedded-opentype'), 
     url('../Fonts/iconFont.svg#iconFont') format('image/svg+xml'), 
     url('../Fonts/iconFont.woff') format('font/x-woff'), 
     url('../Fonts/iconFont.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

I already search on other posts but no luck so far.

Please note that my server is IIS from Microsoft.

Any idea how can I avoid this warning?

Thanks.

解决方案

another approach on here: http://zduck.com/2013/google-chrome-and-woff-font-mime-type-warnings/

use below settings on your web.config:

<system.webServer>
<staticContent>
  <mimeMap fileExtension=".woff" mimeType="application/font-woff"/>
</staticContent>
</system.webServer>

这篇关于Google警告:资源解释为字体,但使用MIME类型应用程序/八位字节流传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆