Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

qooxdoo

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 ?

like image 505
Raptor Avatar asked May 23 '13 03:05

Raptor


2 Answers

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.

like image 118
Daniel Wagner Avatar answered Nov 05 '22 13:11

Daniel Wagner


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

<system.webServer>
  <staticContent>
    <remove fileExtension=".woff" /> 
    <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
  </staticContent>
</system.webServer>
like image 85
Abdullah SARGIN Avatar answered Nov 05 '22 14:11

Abdullah SARGIN