Archived topic
Reduce number of loaded fonts
3 replies · Started by perlfan on January 17, 2021
Hi,
I'm currently working on website speed. I realized that my website loads a lot of font variations which I would like to reduce to the number of variations really used. In Typography -> Body, the font family is set to Roboto, below there are 12 variations selected. The fonts contribute to 50% of the total page size, so I guess there is room for optimization. What happens if I deselect these variations? Are these selected by Generatepress by default? I've noticed that the other Typography categories are set to inherit ...
Thanks for help.
Frank
Hi there,
Deselecting the variations removes them from requests.
Say, for example, you only include 300, 300 italic and 300 bold.
These 3 are the only font variants that the theme will request from the google font servers.
By default, GeneratePress theme uses "System stack" on the body, meaning it uses what fonts the visitor has installed in its system. Everything else is then set to inherit meaning it inherits the settings set on body.
Although, if you decide to select anything except "System Stack"(in your case, Roboto), the selected font adds all the variants by default. You may remove the variants you don't need.
Hi Elvin, thanks for the info. I removed the variations to see what happens - the site re-added all the variations previously listed in that field. So I guess these are the variations used in some part of the website. To reduce that number of variations I'd have to use less variations (spotting the text which is formatted in different variations could be a problem though... maybe there is a way for this?!).
Thanks again, Frank
To reduce that number of variations I’d have to use less variations (spotting the text which is formatted in different variations could be a problem though… maybe there is a way for this?!).
You can check all the layout text on what they use on Appearance > Customize > Typography. Check if any of them is set to a font with specified variants. :)