Open nazar-pc opened 8 years ago
Yep that's intentional, unicode-range
was a thing of the future when this project was initially released (the user-agent to grab the woff2
files is quite old).
Will mark this as an enhancement. I'm not sure if this format should be really the new default CSS generation output for all modern browsers or hidden behind fine-grained configuration options.
Unicode range creates complications and I think (not sure, although) that the bullet proof font-face syntax will not work for all browsers with unicode range.
Here's the complication:
https://jakearchibald.com/2014/minimising-font-downloads/
I think this is the reason Google itself doesn't use it. If bullet proof font-face syntax would have worked, Google wouldn't send a different css file based on user agent.
Article is almost 2 years old, this is HUGE for modern web.
Google Fonts DOES use unicode-range
for majority of browsers by default (except, probably, some ancient browsers you should not care about anyway). Where did you saw Google doesn't use it?
There are some browsers, that are not smart enough to download only necessary unicode ranges, but anyway page will still work, and with HTTP/2 will work even faster than downloading single big font file.
Yes I know Google Fonts uses unicode-range. What I meant was that it doesn't use it always. So for Firefox < 44, it doesn't.
HTTP2 is slightly irrelevant here. The question is just about syntax.
Assume you have a code similar to "bullet-proof" syntax with unicode-range added. It won't work in Firefox < 44. Firefox 43 will just download the latin variant.
What google fonts does for Firefox < 44 is that it combines all subsets and doesn't use unicode range in the css.
You can't create a "bullet-proof" syntax with unicode range.
Firefox 44 was released almost 5 months ago. There was 45, 46, 47 stable releases since then. I believe it is a sane choice to drop support for Firefox 43- since this is an evergreen browser. Supported ESR version is based on 45, so this i is clearly not a problem here anyway.
I think the problem is that Google does user-agent sniffing while this project produces a static output. http://fonts.googleapis.com/css?family=Open+Sans:400&subset=latin,latin-ext
@szepeviktor There's nothing preventing you from giving your users the old method if a lot of them have legacy browsers.
Plus, I don't know what's the default behaviour in browsers that don't support it, but if they don't take it into account and download everything, they'll have all the fonts. The only difference will be a couple more http requests when all the ranges are not needed.
If performance AND compatibility are REALLY an issue, there's nothing preventing your from doing user agent sniffing either.
Looks like all fonts are downloaded as single file with selected characters supported, while I'd like to have versions with
unicode-range
, which now works in all modern browsers to download fewer bytes. Will it be supported at some point or how it works currently is intentional?