Google Fonts: speed up, trim and host fonts locally
The Google Fonts tab (Baza Helper > Google Fonts) works with every theme and page builder that loads fonts from Google. It changes the links in the finished page. Nothing is added to what the site asks for, and fonts from your own server, icon fonts and other addresses are never touched.
Quick wins
- Add display=swap: text shows in a system font until the web font arrives, instead of staying invisible. An existing display value is never replaced.
- Connect to Google Fonts early: adds preconnect hints for fonts.googleapis.com and fonts.gstatic.com, once.
Load less
- Only these weights: for example
400,600,700. A weight such as 400 keeps the upright style; add400italicto keep the italic too. Allowed are 100 to 900 in steps of 100. A family goes only when none of its styles is listed. Empty means the addresses stay as they are. - Allowed font families: for example
Open Sans, Roboto. Every other family is removed from the address with all its weights. Empty means no family is removed. - Also drop families the page never uses: reads the page’s own CSS and leaves out a family it never names, and italics when nothing is italic. Check the page after turning this on.
Host the fonts on this site
Host the fonts on this site copies the Google Fonts stylesheet and its font files into your uploads folder and loads them from there. The first screen no longer waits for two extra connections. The copy is made in the background after the first visit, and until it exists the page keeps loading from Google. Visitors no longer send their address to Google for fonts, so check your privacy text.
See what the page asks for
Press Check the home page in What the home page asks for. It shows the families and styles found on the home page and the address that results with the values in the form, even before you save. It also tells you when a rule was left as it was: no style of any family would remain, none of its families is on the allowed list, or the address could not be cut safely.
