From d041904a7d68078d307f0c7e679b5acc1aed6d9b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 2 Feb 2021 18:35:27 +0000 Subject: [PATCH] Block Editor: Drop Noto Serif in favor of system fonts. This aims to improve privacy and performance of the editor. Follow-up to [37361]. Props Joen, hellofromTonya, garrett-eclipse, aristath, noisysocks, hedgefield, pento, sabernhardt, joyously, yannkozon. Fixes #46169. git-svn-id: https://develop.svn.wordpress.org/trunk@50155 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/edit-form-blocks.php | 3 +-- src/wp-includes/script-loader.php | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/edit-form-blocks.php b/src/wp-admin/edit-form-blocks.php index 2c46e4d504..48a9ebd3dd 100644 --- a/src/wp-admin/edit-form-blocks.php +++ b/src/wp-admin/edit-form-blocks.php @@ -193,8 +193,7 @@ $styles = array( ), ); -/* translators: Use this to specify the CSS font family for the default font. */ -$locale_font_family = esc_html_x( 'Noto Serif', 'CSS Font Family for Editor Font' ); +$locale_font_family = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif'; $styles[] = array( 'css' => "body { font-family: '$locale_font_family' }", ); diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index 3a9ac203de..ce4c99e2ea 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1474,7 +1474,7 @@ function wp_default_styles( $styles ) { $styles->add( 'colors-fresh', false, array( 'wp-admin', 'buttons' ) ); // Old handle. $styles->add( 'open-sans', $open_sans_font_url ); // No longer used in core as of 4.6. - // Packages styles. + // Noto Serif is no longer used by core, but may be relied upon by themes and plugins. $fonts_url = ''; /* @@ -1486,7 +1486,7 @@ function wp_default_styles( $styles ) { if ( 'off' !== $font_family ) { $fonts_url = 'https://fonts.googleapis.com/css?family=' . urlencode( $font_family ); } - $styles->add( 'wp-editor-font', $fonts_url ); + $styles->add( 'wp-editor-font', $fonts_url ); // No longer used in core as of 5.7. $styles->add( 'wp-block-library-theme', "/wp-includes/css/dist/block-library/theme$suffix.css" ); @@ -1503,10 +1503,7 @@ function wp_default_styles( $styles ) { ); $package_styles = array( - 'block-editor' => array( - 'wp-components', - 'wp-editor-font', - ), + 'block-editor' => array( 'wp-components' ), 'block-library' => array(), 'block-directory' => array(), 'components' => array(),