Created
September 23, 2016 12:09
-
-
Save kdarty/a984201e64d06c916085a07ba3c6930f to your computer and use it in GitHub Desktop.
Define Web Font Mime Types within the Web.config of an ASP.NET Project to ensure that the Web Server properly handles serving up your Fonts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.webServer> | |
<staticContent> | |
<!-- Remove any potential Web Server Settings for Web Fonts to be used --> | |
<remove fileExtension=".eot" /> | |
<remove fileExtension=".otf" /> | |
<remove fileExtension=".ttf" /> | |
<remove fileExtension=".woff" /> | |
<remove fileExtension=".woff2" /> | |
<!-- Define Web Font Mime Types that will be used --> | |
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" /> | |
<mimeMap fileExtension=".otf" mimeType="application/font-sfnt" /> | |
<mimeMap fileExtension=".ttf" mimeType="application/font-sfnt" /> | |
<mimeMap fileExtension=".woff" mimeType="application/font-woff" /> | |
<mimeMap fileExtension=".woff2" mimeType="font/woff2" /> | |
<!-- Define SVG Mime Type (could be used for Images or Fonts) --> | |
<remove fileExtension=".svg" /> | |
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> | |
</staticContent> | |
</system.webServer> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
application/font-sfnt
is not the right mimetype forttf
orotf
- not sure why you would use it?Try
application/x-font-ttf
orapplication/x-font-truetype
forttf
andapplication/x-font-opentype
forotf
Edit: I can see some history on it here: https://stackoverflow.com/a/20723357 hope this helps others! <3