-
Notifications
You must be signed in to change notification settings - Fork 300
Reduce size of webfont payload #448
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
Found a typo, fixing. |
8629b7f
to
8a5c9cd
Compare
Typo fixed. I had accidentally removed the |
8a5c9cd
to
8c3f29f
Compare
@chriskrycho since you are who added this - could you take a look? thanks! |
Ah, very nice – thank you for this pr, @msmorgan! I'm a big fan of going to woff/woff2 wherever possible. A couple notes:
|
@chriskrycho I copied the faces and styles directly from the Fira repository. It was last updated 3 years ago, and I suppose it was best practice at that time to use eot fonts. I'll go ahead and remove the eot fonts, as well as the ttf fonts for Fira Sans. I looked online and could not find a woff or woff2 version of Alfa Slab One. I found some online conversion tools, but I'm not sure if the license of Alfa Slab One allows the conversion. |
8c3f29f
to
fb9991d
Compare
I found a tool (font-ranger) capable of splitting the fonts into separate versions for different Unicode ranges. I ran that on all the fonts, which had the side effect of converting Alfa Slab One to woff and woff2. I generated a new version of fonts.css using sass. |
ca66d40
to
3f4d3a8
Compare
Outstanding! I will re-review in a bit and test locally as well, but thank you so much for doing that! |
I think I'm done fiddling with this now. On the homepage the font payload is now less than 90kB. |
That is fantastic! Thank you so much for pushing that down so far. I will test and this should be merged tomorrow! |
@chriskrycho If you'd like, I can squash the first few commits so the unused fonts don't end up in the version history. |
That would be great – a nice bit of savings of download bandwidth in its own way! |
05db145
to
57f4d16
Compare
The package 'font-ranger' on NPM was used to process the fonts.
57f4d16
to
f4bc19f
Compare
@chriskrycho I've cleaned up the commit history. This should be ready to merge. |
Perfect! I'll verify/test myself and merge by the end of the day! Thank you again; this is really outstanding. |
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.
Thanks again! Merged!
This brings down the size of the fonts dramatically by using woff and woff2 and splitting the fonts into Unicode subranges. The full font payload on the home page goes from approximately 3MB to less than 90kB.
The fonts.css stylesheet is now generated by the SASS compiler on app launch.