I have not been able to find a canonical source that indicates the correct MIME type for any and/or each type of file format. All the sources that I have found appear to contradict each other and/or the IANA MIME type RFCs and their associated list.
While I am particularly interested in .otf
(OpenType) and .ttf
(TrueType) file types, an ideal answer would provide a canonical resource for determining the MIME types for a broad spectrum of font file formats, such as those listed on the Font file section of the Wikipedia page: List of file formats. However, given that I can't find such a resource, it seems entirely possible that no such canonical reference exists.
I would like to further clarify that I am not looking for the working MIME type, but for the canonical MIME type. The selected answer to Proper MIME type for fonts states that font/opentype
can be used for .otf
file. However, as the highest voted answer (by @djsadinoff) explains, font
is not a valid IANA content type and this cannot be the correct MIME type.
The lack of a specific media type for font files resulted in the confusing, ever-changing and contradictory mess that smartcaveman describes above. Back in 2012, this question couldn’t really be answered because other than the IANA list, no such canonical reference did exist. Thankfully, this situation has since been rectified …
In February this year (2017), the W3C published the Standards Track RFC 8081: The "font" Top-Level Media Type which greatly simplifies the appropriate media types for font files:
This memo serves to register and document the "font" top-level media type, under which subtypes for representation formats for fonts may be registered. This document also serves as a registration application for a set of intended subtypes, which are representative of some existing subtypes already in use, and currently registered under the "application" tree by their separate registrations.
It’s quite a readable document and it describes the historical context (lack of “a registration of formats for font”) which gave rise to the confusing mix of media types and sub-types. With the (relatively) recent rise in popularity of downloadable web fonts, the W3C recognised the need for an “intuitive top-level font type”. What they came up with is: font
.
Accordingly, the IANA have since updated their official list of Media types with the font
media type and all its sub-types that they currently recognise:
collection font/collection
otf font/otf
sfnt font/sfnt
ttf font/ttf
woff font/woff
woff2 font/woff2