A snippet to make your Google Fonts render faster
Google Fonts now have built-in
font-displaysupport, and there’s no much sense to use this tool over the native feature.
To make use of the native support for
font-display, just append
&display=swapto the end of you Google Fonts URL.
When you use a custom font (like a font from Google Fonts), most modern browsers won’t render the text immediately. Instead, they will keep the text hidden until the font is downloaded – or until 3 seconds pass. This hurts user experience – and affects business metrics.
This repo includes a source of
googlefonts.3perf.com, a tool that generates snippets that speed up Google Fonts rendering. See the tool page for more information on how it works.