Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font MIME types following RFC 8081 #114

Merged
merged 6 commits into from
Sep 18, 2017
Merged

Font MIME types following RFC 8081 #114

merged 6 commits into from
Sep 18, 2017

Conversation

LeoColomb
Copy link
Member

@LeoColomb LeoColomb commented Sep 16, 2017

Recent changes introduced by the RFC 8081 and registered at IANA.

Current New
application/x-font-ttf font/ttf
font/opentype font/otf
application/font-woff font/woff
application/font-woff2 font/woff2
application/x-font-ttf (ttc) font/collection

@mathiasbynens
Copy link
Member

mathiasbynens commented Sep 16, 2017

Which browsers support these MIME types?

Update: This thread answers it: jshttp/mime-db#77

@LeoColomb
Copy link
Member Author

At least the latest version of modern browsers, but this is hard to say except not being able to produce an error.
That said, browsers usually ignore the font media types and simply sniff the bytes to figure out the font type.

Also, as an example, Google Fonts already use these "new" types:

$ curl -I https://fonts.gstatic.com/s/lato/v13/9k-RPmcnxYEPm8CNFsH2gg.woff

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: font/woff
[...]

Extracted from Lato served for IE

$ curl -I https://fonts.gstatic.com/s/lato/v13/UyBMtLsHKBKXelqf4x7VRQ.woff2

HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Type: font/woff2
[...]

Extracted from Lato served for Chrome

@LeoColomb
Copy link
Member Author

This is a very good link, thanks!

But this seems to be kind a vicious circle: if everyone wait to the other be updated, no one will do.
Most of the time it can be understandable to avoid errors and breaking things, but in our case the worst thing this change could raise is a notice in some old browsers. 🤔

Isn't it? What is your opinion?
🙂

@mathiasbynens
Copy link
Member

Yeah, I agree this should be merged! Could you please take a look at the CI failure?

@mathiasbynens
Copy link
Member

Any reason why font/sfnt is not added?

@LeoColomb
Copy link
Member Author

LeoColomb commented Sep 18, 2017

Could you please take a look at the CI failure?

Builds fail since trusty for all builds on Travis: sudo is required for some scripts but not granted. .travis.yml may be updated. See #115.

Any reason why font/sfnt is not added?

Yes, because font/sfnt is a general case for both font/otf and font/ttf, see https://www.iana.org/assignments/media-types/font/sfnt:

Note that "font/sfnt" is an abstract type from which the (widely
used in practice) "font/ttf" and "font/otf" types are conceptually
derived. Use of "font/sfnt" is likely to be rare in practice, and
might be confined to:

  • Uncommon combinations such as "font/sfnt; layout=sil" that do not have a shorter type

  • Cases where a new parameter value is registered

  • Test cases, experimentation, etc.

@LeoColomb
Copy link
Member Author

Rebased.

@mathiasbynens mathiasbynens merged commit 20b446e into h5bp:master Sep 18, 2017
@mathiasbynens
Copy link
Member

👍

@XhmikosR
Copy link
Member

@LeoColomb: Shouldn't we remove the old types completely?

@LeoColomb
Copy link
Member Author

I would keep them for compatibility as software may force them.
But that said, I don't know at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants