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

Reconsider WOFF2 #8

Closed
mathiasbynens opened this issue Apr 29, 2015 · 8 comments
Closed

Reconsider WOFF2 #8

mathiasbynens opened this issue Apr 29, 2015 · 8 comments

Comments

@mathiasbynens
Copy link

https://github.com/mmastrac/webfont-dl#woff-v2

Now that WOFF2 is supported by Chrome, Opera, and Firefox, has the time come to download WOFF2 font versions by default?

@mmastrac
Copy link
Owner

Still waiting on Safari and for WOFF2 to make it into the stable channels of every browser unfortunately. I would wager within a year this can flip. Leaving open as a tracking bug.

@konklone
Copy link

@mmastrac If WOFF2 were listed as an option in the resulting .css file, would browsers which don't support it try and fail to use it, and have broken fonts? Is there any downside to including WOFF2 in the file for browsers that don't support it?

@mmastrac
Copy link
Owner

Oh crap -- I think I just realized the confusion. The WOFF2 support page is here: http://caniuse.com/#feat=woff2 (I linked to WOFF by accident)

I'll fix the link on the front page. Does this make sense?

@mathiasbynens
Copy link
Author

@konklone

If WOFF2 were listed as an option in the resulting .css file, would browsers which don't support it try and fail to use it, and have broken fonts?

No. (But as webfont-dl inlines the font as a base64-encoded data URL by default, it would increase the resulting file size.)

Is there any downside to including WOFF2 in the file for browsers that don't support it?

No.

TL;DR Everything is awesome!

@mmastrac
Copy link
Owner

The downside is basically size, which is somewhat antithetical to the reasons you'd use WOFF2: the byte savings over WOFF.

If you're including WOFF+WOFF2, that'll be on average ~170% of the size of a WOFF-only CSS file (I'd say this is probably something to avoid).

If you inline WOFF2 and link WOFF, cutting edge browsers will potentially save 30-50% on the CSS download, but modern browsers that don't speak WOFF2 yet (Safari, IE) will pay a reasonably large penalty having downloaded the CSS, ignored the WOFF2 and moved on to WOFF.

I'd say that if you can guarantee that most of your users are on Chrome and Firefox 39+ (currently not actually the stable version), then enabling WOFF2 is probably a win. If not, I'd suggest sticking with the default.

@mmastrac
Copy link
Owner

mmastrac commented Jan 4, 2016

I'm quickly revisiting this since the web is moving quickly these days -- http://caniuse.com/#feat=woff2 suggests that WOFF2 is 50%+ of the global market share which means that it might be worth adding a non-default flag to enable this profile.

Adding help wanted.

@mmastrac
Copy link
Owner

woff2 support is now at 80% - when I get a chance I'll make this the default.

@mmastrac
Copy link
Owner

mmastrac commented Feb 4, 2019

Committed

@mmastrac mmastrac closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants