-
Notifications
You must be signed in to change notification settings - Fork 65
Switch bundled font file type from woff to woff2 #1004
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
Conversation
|
I think the failures here will have to be fixed by https://github.com/r-lib/actions/releases/tag/v2 |
|
I was a little worried about the number of changed files. It turns out the number of font files has gone up quite a bit, but the overall size is somewhat smaller. Beforels -l inst/fonts | grep "^-" | wc -l
#> 70Afterls -l inst/fonts | grep "^-" | wc -l
#> 151 |
gadenbuie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Would the change in sass::read_gfont_url() affect thematic? Asking because these error seem possibly related.
No, thematic has its own standalone gfont logic that seems to always uses |
|
Is this Windows problem related? Only in Windows the font is not available for a shiny app, with errors: The workaround (for windows) is to add the I don't know if this related to the use of |

Closes #1002 (at least partially)
This PR should fix the "constantly updating" font files mentioned in #1002 by switching from
wofftowoff2. The difference in browser support nowadays is barely noticeable (97.98% vs 97.32%). Essentially the only difference is a drop of IE11 support, which Bootstrap 5 has officially dropped. As an additional benefit, the compression of the font files should be much better with woff2.As a technical note, the font file downloading script (
tools/download_preset_files.R) sets theUser-Agentwhen requesting files to a modern version of Chrome, just to let Google Fonts know that we'd likewoff2(surprisingly, there doesn't seem to be any other way to do this). It's worth noting thatsass:::read_gfont_urldoes something similar to getwofffiles. We may want to consider updating the User-Agent there as well, but I'm a bit skeptical the other issues we've been seeing would be fixed by that.