IT TIP

리소스가 글꼴로 해석되지만 MIME 유형 application / x-font-woff로 전송 됨

itqueen 2020. 12. 9. 22:04
반응형

리소스가 글꼴로 해석되지만 MIME 유형 application / x-font-woff로 전송 됨


qooxdoo 문서 웹 글꼴 자습서 를 따라 Font.js에 웹 글꼴을 추가했지만 Chrome의 개발자 콘솔에 경고가 있음을 알았습니다.

내 코드는 다음과 같습니다.

/* ************************************************************************
  #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"
                ]
            }
        ]
    }
  }
});

브라우저 경고를 어떻게 해결할 수 있습니까?


W3C 사양 에 따르면 올바른 MIME 유형은입니다 application/font-woff. 따라서 .woff 파일을 제공 할 때이를 사용하도록 웹 서버를 구성해야합니다.


IIS 웹 서버를 사용하는 경우 다음을 시도해보십시오.

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

참고 URL : https://stackoverflow.com/questions/16704967/resource-interpreted-as-font-but-transferred-with-mime-type-application-x-font-w

반응형