-
Notifications
You must be signed in to change notification settings - Fork 140
Our Fonts folder is too big, we need a good solution to cut it down #542
Comments
We've discussed only including the variable fonts in the theme, and using a stack of system fonts in browsers that do not have support for variable fonts. You can find a list of browsers without variable fonts support here). Only including the variable fonts would bring the size of the Inter folder down to 470 KB. Visitors using older browsers would be bit worse off typographically (as in the IE11 screen capture without Inter above), but they would at least get smaller page sizes in the bargain. |
I presume #492 reduced the size of the font-stack somewhat? |
@ntwb I'm afraid that #492 didn't really decrease the total font size. These will be the folder sizes once #118 got merged:
Please note that the following fonts will only be loaded as a non-latin fallback font when required:
cc: @ianbelanger79 & @andersnoren |
There was someone in #core today, saying that they tried to install the Beta to test, and it timed out halfway through the download (looked like ~10meg out of ~20meg). The zip for WordPress has increased in size with every release, but it shouldn't be larger mostly because of the theme's fonts! Please just use the fonts that the admin already uses or the generic |
@joyously You're saying we should rollback #118 and instead of using custom fonts use system fonts and/or generic @andersnoren What is your share on that. I agree with @joyously that the default theme shouldn't be too big. When including all fallback fonts into the theme, the zip file would be around 30 MB. @joyously & @andersnoren Would it be an option to load |
There's GDPR issues with this direction I believe |
@joyously @nielslange I think loading only the variable fonts will keep the theme size down to a tolerable size, while still giving as many users as possible as good of an experience as possible. Especially as support for variable fonts grows more widespread. Relying only on system fonts for all visitors will guarantee some visitors to have a worse experience than others, which I'm not a fan of. @nielslange We will have to rely on the Google Fonts CDN for the non-latin fonts, or go back to using system fonts if the people in #privacy insists. I would prefer going the Google Fonts CDN route, and giving users an easy way to opt-out. Increasing the theme folder size by 26 MB isn't doable. Inter isn't available on Google Fonts, so using a CDN isn't an option there. |
Would you rather load the fonts Google Fonts CDN by default and let folks opt-out or don't load them until folks opted-in? I'm not sure if the first option violated GDPR rules as the fonts would get loaded initially without the user's consent. In any way, I'll update this PR and add a Google Fonts CDN toggle to the customizer. |
I'm not sure either. @garrett-eclipse, could you give us some input from a privacy perspective? |
Thanks for the ping @andersnoren and discussion everyone. From a privacy and performance standpoint I would place my vote on system fonts. The issue with Google Fonts from a privacy standpoint is it leaks PII (Personally Identifiable Information) to Google, at minimum your IP address but I also believe User Agent is collected. This is a privacy concern as no consent was attained before this collection. In general, the privacy team is working on removing or internalizing external components and services used by core. This started with the admin (https://core.trac.wordpress.org/ticket/36753) removing Open Sans and with Twenty Nineteen as the first theme to avoid them it was expected future themes would follow this lead (https://core.trac.wordpress.org/ticket/46170#comment:2). As well as bundling them in the older themes. We are also working on having it removed in Gutenberg (https://core.trac.wordpress.org/ticket/46169) which is just pending sign-off from Gutenberg design lead(s) (WordPress/gutenberg#11648). Pulling from these threads some helpful quotes;
Reference: https://core.trac.wordpress.org/ticket/46343#comment:17
Reference: https://core.trac.wordpress.org/ticket/46169
Reference: https://core.trac.wordpress.org/ticket/46169#comment:5
(Note: This comes from the EuGH German legislation.) Some of the longer more involved discussions are below (didn't want to overwhelm with walls of text); So to summarize, using a CDN is a privacy concern, using bundled fonts seems to be increasing the package size overly much, opt-out is against privacy principles and some legislations. So we're left with either an opt-in model which should also come with privacy policy suggested content or system fonts. |
@garrett-eclipse Thanks for your detailed explanation. @andersnoren Which brings us back to the question:
|
* Remove the non-variable versions of Inter * Removed mentions of non-variable Inter from editor styles, RTL styles Partial fix for #542
@garrett-eclipse Thank you for the explanation, and sorry for not getting back to you sooner. After thinking it through and talking it over, we've decided to limit the font stacks used for the non-latin fonts to system fonts only. I have updated the non-latin fonts issue (#118), and I took the liberty of including a link to your comment in this issue for those who want to learn more about why Google Fonts should not be used in Twenty Twenty. |
Thanks @andersnoren I appreciate the update and decision, the Privacy team thanks you and all for their efforts in this matter. |
Closed in favour of #118 |
We are using the Inter variable font, which is great for most browsers. However, since we have to support IE11 and earlier versions of Edge, we must include over 20 Inter font files.
We need to figure out a good solution to cut down our current themes folder which is over 3MB.
The text was updated successfully, but these errors were encountered: