Resource interpreted as Font but transferred with MIME type application/x-font-woff

匿名 (未验证) 提交于 2019-12-03 01:08:02

问题:

I followed the Web Fonts tutorial in qooxdoo documentation to add a web font to Font.js , but I notice there is a warning in Chrome's Developer Console:

My code is as follow:

/* ************************************************************************   #asset(myApp/fonts/*) ************************************************************************ */ qx.Theme.define("myApp.theme.Font", {   extend : qx.theme.simple.Font,    fonts :   {     "silkscreen" :     {         size: 8,         lineHeight: 1,         family: [ "silkscreen", "Tahoma" ],         sources:         [             {                 family: "Silkscreen",                 source:                 [                     "myApp/fonts/slkscr-webfont.eot",                     "myApp/fonts/slkscr-webfont.ttf",                     "myApp/fonts/slkscr-webfont.woff",                     "myApp/fonts/slkscr-webfont.svg#silkscreen"                 ]             }         ]     }   } }); 

How can I resolve the browser warning ?

回答1:

According to the W3C spec, the correct MIME type is application/font-woff, so you need to configure your web server to use that when serving .woff files.



回答2:

If you are using an IIS webserver, give this a try:



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