Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
348 views
in Technique[技术] by (71.8m points)

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

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...