On 3/10/14 01:11, Jonas Sicking wrote:
On Thu, Oct 2, 2014 at 9:42 AM, Jonathan Kew <jfkth...@gmail.com> wrote:
Or do people need to hardcode
UA versions to know what UAs support it?


I believe that's what Google Fonts currently does, though IMO a better
approach is to serve CSS that offers both WOFF2 and older (more
widely-supported) formats, using the @font-face src descriptor's "format
hint" to let the browser choose the optimal resource depending on what it
supports:

   @font-face {
     font-family: MyFont;
     src: url(myfont.woff2) format("woff2"),
          url(myfont.woff) format("woff"),
          url(myfont.eot) format("embedded-opentype"),
          url(myfont.ttf) format("truetype");
   }

Could we at least add woff2 to the Accept header when fetching fonts?


Sounds like a good suggestion in principle.

Wondering what we currently send in that header, I looked at some font requests in the DevTools Network panel... it seems we fetch fonts using

  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

which doesn't look even remotely sensible. If we're going to adjust this, we should probably not simply add woff2 to this but do a more thorough cleanup job.

For comparison, Chrome appears to use simply

  Accept:*/*

and Safari, at least according to its inspector, doesn't send an Accept header at all when fetching fonts. (Or images, for that matter.)

I just filed bug 1077312. However, I don't think this needs to actually block the implementation of WOFF2 support.

JK

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to