WordPress.org

Make WordPress Core

Opened 2 weeks ago

Last modified 5 days ago

#46169 new enhancement

Use system fonts for the block editor

Reported by: garrett-eclipse Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.0
Component: Editor Keywords: needs-patch needs-design
Focuses: performance, privacy Cc:

Description

Following from a discussion in #core-privacy I'm opening this to move on the Google Fonts issue with Gutenberg.
Discussion - https://wordpress.slack.com/archives/C9695RJBW/p1549043771637800

There's two main concerns;

  1. From a privacy standpoint Google Fonts tracks users potentially collecting PII
  2. From a performance standpoint the assets should be served locally to take advantage of modern font-loading optimization, etc. The cross-domain request slows down the site even with pre-fetching.

This was originally raised in Gutenberg Github and closed as it's now a core issue;
https://github.com/WordPress/gutenberg/issues/11648

This was perviously done in 4.6 to remove Open Sans as done here;
https://core.trac.wordpress.org/ticket/36753

Thank you

Change History (7)

#1 @garrett-eclipse
2 weeks ago

Specifically, this is for the replacement of Noto Serif the Google Font used by the block editor.

Core reference - https://github.com/WordPress/WordPress/blob/3c7a623f85f4648eded5cbcf340ccb5c9cc3b2fb/wp-includes/script-loader.php#L1929-L1938

#2 @joyously
2 weeks ago

This would be better for when the styles are being overridden also.

This ticket was mentioned in Slack in #core-privacy by garrett-eclipse. View the logs.


13 days ago

#4 in reply to: ↑ description @pento
13 days ago

  • Keywords needs-design added

Replying to garrett-eclipse:

  1. From a privacy standpoint Google Fonts tracks users potentially collecting PII

Is there a reference for this? Reading through this discussion and the related FAQ, it seems like Google logs minimal data from Google Fonts requests.

  1. From a performance standpoint the assets should be served locally to take advantage of modern font-loading optimization, etc. The cross-domain request slows down the site even with pre-fetching.

Google Fonts is pretty fast. The first request to load the block editor from my site takes ~8s, of which 80ms is Noto Serif. Subsequent loads are 4s for the page load, and 0ms for Noto Serif, thanks to caching. This seems like a premature optimisation.

I'll defer to the design team as to whether system fonts are a better (or at least equivalent) writing experience compared to Noto Serif.

#5 @aristath
12 days ago

Is there a reference for this? Reading through this discussion and the related FAQ, it seems like Google logs minimal data from Google Fonts requests.

Google claims it logs minimal data, however there is no mention whatsoever of what data gets logged, for how long the logs remain and what kind of processing google then does on the logged data. Google's FAQ only states that "The Google Fonts API is designed to limit the collection, storage, and use of end-user data to what is needed to serve fonts efficiently" without providing any specifics.
The vagueness of their docs, the lack of information and specificity is what makes them a serious GDPR concern.

Google Fonts is pretty fast.

In general yes, they're pretty fast. But that's only because your connection and mine are fast. But a few days ago when there were heavy rains in my area for example and connection speeds were suffering, gfonts were a constant pain. We should not assume that everyone has a decent network or that they have the luxury of an 80ms request for webfonts.

I'll defer to the design team as to whether system fonts are a better (or at least equivalent) writing experience compared to Noto Serif.

Note Serif is a better experience, there's no doubt about that. It's a beautiful font. But it's not what themes use on the frontend so the editor should not assume anything and should not use an opinionated font. If a theme uses Noto Serif then it should enqueue it on its own in the editor.

#6 @joyously
12 days ago

Note Serif is a better experience, there's no doubt about that. It's a beautiful font.

Only in certain languages. If you use system fonts, there is no lag, no privacy concern, and the user gets the font they've already chosen as very readable. If this is just for the editor chrome, it's the best choice to use system fonts (like sans-serif). If it's for the content, the editor should not be specifying anything at all.

This ticket was mentioned in Slack in #core-privacy by dejliglama. View the logs.


5 days ago

Note: See TracTickets for help on using tickets.