What is the correct MIME type for a font file?

I was unable to find a canonical source that indicates the correct MIME type for any and / or each file type. All the sources I found contradict each other and / or RFCs like IANA MIME and the list associated with them .

While I am particularly interested in .otf(OpenType) and .ttf(TrueType) file types , the ideal answer would provide a canonical resource for defining MIME types for a wide range of font file formats, such as those listed in the Font File section of the Wikipedia page: List of file formats . However, given that I cannot find such a resource, it is entirely possible that such a canonical reference does not exist.

I would like to further clarify that I am not looking for a working MIME type, but for a canonical MIME type. The selected answer The correct MIME type for fonts indicates what font/opentypecan be used for the file .otf. However, as the older answer (by @djsadinoff) explains, fontit is not a valid IANA content type, and it cannot be the correct MIME type.

+5
source share
5 answers

For your question, you may not know about the type of font. Use this link Font MIME Types .

roc -, , IE DRM . (, , TrueType OpenType .) , DRM . , , , , , .

W3C

+7

.

4.5.1. Octet-Stream

"-" , .

4

(5)   application -- some other kind of data, typically
      either uninterpreted binary data or information to be
      processed by an application.  The subtype "octet-
      stream" is to be used in the case of uninterpreted
      binary data, in which case the simplest recommended
      action

, , mime- linux file().

    $ file --mime-type 
    Days-webfont.ttf: application/octet-stream

- !

, . ? Mozilla...

.. TrueType, OpenType MIME, Web Open File Format (WOFF), MIME .

Mozilla , MIME .ttf.otf .woff.

Mozilla ,

MIME-

MIME

, , MIME, .

, a > , , MIME .

IANA | MIME Media Types, MIME.

Netscape Gecko, > "" > " ", , MIME .

FILExt , , MIME > .

FILExt , , () bash.

, ; vnd.ms-fontobject, .eot, font-tdpfr, .pfr.

,

. , , () , .

+4

:

mime "application/x-font-opentype" "application/octet-stream". - , , " ", - " "

, MIME , MIME MIME. RFC2046, , , . , .

+2

OpenType TrueType, , - "" MIME.

Open Open Font Format, , application/font-woff ( W3C). OpenType - OpenType - application/vnd.ms-fontobject ( Microsoft).

, application/font-tdpfr TrueDoc. Netscape Navigator 4. ☺

+1

, , . 2012 , , IANA, . , ​​...

(2017 ) W3C RFC 8081: " " , :

, . , "" .

His document is quite readable and describes the historical context (lack of "registration of font formats"), which gave rise to an intricate combination of media types and subtypes. With the (relatively) recent rise in popularity of downloadable web fonts, the W3C has recognized the need for an "intuitive type of top-level font." What they came up with this: font.

Accordingly, the IANA has since updated the official official list of multimedia types with the type fontand all its subtypes, which they currently recognize:

collection  font/collection
otf     font/otf
sfnt    font/sfnt
ttf     font/ttf
woff    font/woff
woff2   font/woff2
+1
source

All Articles