Searching the web, I find heaps of different suggestions for what the proper MIME type for a font is, but I have yet to try any MIME type that rids me of a Chrome warning such as the following:
Resource interpreted as font but transferred with MIME type font/otf
The font is an OTF.
I've tried the following MIME types so far
- font/otf
- application/font-otf
- application/font
- application/otf
- application/octet-stream
- application/x-font-otf
- application/x-font-TrueType (I know it's not truetype, but one source quoted this for OTF)
There are a number of font formats that one can set MIME types for, on both Apache and IIS servers. I've traditionally had luck with the following:
According to the Internet Engineering Task Force who maintain the initial document regarding Multipurpose Internet Mail Extensions (MIME types) here: http://tools.ietf.org/html/rfc2045#section-5 ... it says in specifics:
As it were, and over time, additional MIME types get added as standards are created and accepted, therefor we see examples of vendor specific MIME types such as vnd.ms-fontobject and the like.
UPDATE August 16, 2013: WOFF was formally registered at IANA on January 3, 2013 and Webkit has been updated on March 5, 2013 and browsers that are sourcing this update in their latest versions will start issuing warnings about the server MIME types with the old x-font-woff declaration. Since the warnings are only annoying I would recommend switching to the approved MIME type right away. In an ideal world, the warnings will resolve themselves in time.
UPDATE February 26, 2015: WOFF2 is now in the W3C Editor's Draft with the proposed mime-type. It should likely be submitted to IANA in the next year (possibly by end of 2016) following more recent progress timelines. As well SFNT, the scalable/spline container font format used in the backbone table reference of Google Web Fonts with their sfntly java library and is already registered as a mime type with IANA and could be added to this list as well dependent on individual need.
UPDATE October 4, 2017: We can follow the progression of the WOFF2 format here with a majority of modern browsers supporting the format successfully. As well, we can follow the IETF's "font" Top-Level Media Type request for comments (RFC) tracker and document regarding the latest set of proposed font types for approval.
For those wishing to embed the typeface in the proper order in your CSS please visit this article. But again, I've had luck with the following order:
For Subversion auto-properties, these can be listed as:
The following can be used in the eBook space:
application/vnd.ms-opentype
I would imagine that it is the same for the web.
One way to silence this warning from Chrome would be to update Chrome and then make sure your mime type is one of these:
This list is per the patch found at Bug 111418 at webkit.org.
The same patch demotes the message from a "Warning" to a "Log", so just upgrading Chrome to any post March-2013 version would get rid of the yellow triangle.
Since the question is about silencing a Chrome warning, and folks might be holding on to old Chrome versions for whatever reasons, I figured this was worth adding.
Ignore the chrome warning. There is no standard MIME type for OTF fonts.
font/opentype may silence the warning, but that doesn't make it the "right" thing to do.
Arguably, you're better off making one up, e.g. with "application/x-opentype" because at least "application" is a registered content type, while "font" is not.
Update: OTF remains a problem, but WOFF grew an IANA MIME type of application/font-woff in January 2013.
Update 2: OTF has grown a MIME type: application/font-sfnt In March 2013. This type also applies to .ttf
Try using "font/opentype".
As from March 2013 IANA.ORG recommends for .otf:
application/font-sfnt
Other fonts:
See more...