我有一个字体在我的程序生成从Font Squirrel我只是无法让它在IIS中工作,它在本地主机工作。 我将应用程序/ font-woff 文章添加到我的MIME类型,但它仍然不想工作。
Context --Fonts ----font location --css filesCSS
@font-face { font-family: 'wallStreetFont'; src: url('Fonts/subway-webfont.eot'); src: url('Fonts/subway-webfont.eot?#iefix') format('embedded-opentype'), url('Fonts/subway-webfont.woff2') format('woff2'), url('Fonts/subway-webfont.woff') format('woff'), url('Fonts/subway-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; }编辑当前MIME
我使用默认IIS 8 MIME 字体/ x-woff
I have a font-face in my program generated from Font Squirrel I just can't get it to work in IIS, it works in localhost. I added application/font-woff article to my MIME Types but it still doesn't want to work.
Context --Fonts ----font location --css filesCSS
@font-face { font-family: 'wallStreetFont'; src: url('Fonts/subway-webfont.eot'); src: url('Fonts/subway-webfont.eot?#iefix') format('embedded-opentype'), url('Fonts/subway-webfont.woff2') format('woff2'), url('Fonts/subway-webfont.woff') format('woff'), url('Fonts/subway-webfont.ttf') format('truetype'); font-weight: normal; font-style: normal; }EDIT CURRENT MIME
I am using the default IIS 8 MIME font/x-woff
最满意答案
很高兴看到WOFF2被包含在字体松鼠字体中! 虽然IIS 8不需要为WOFF添加的MIME类型,但它将需要一个用于WOFF2 。 W3C 建议 :
application/font-woff2有关WOFF2更多信息,请参阅此处 。
要在IIS中添加mime类型,请修改Web.Config ,如下所示:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- ... --> <system.webServer> <!-- ... --> <staticContent> <!-- ... --> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />Great to see WOFF2 being included in Font Squirrel fonts! Whilst IIS 8 does not need a mime type added for WOFF it will need one for WOFF2. The W3C recommends:
application/font-woff2For more info on WOFF2 see here.
To add the mime type in IIS, modify your Web.Config as follows:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- ... --> <system.webServer> <!-- ... --> <staticContent> <!-- ... --> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />更多推荐
发布评论