diff --git a/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php b/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php
index 84375b6c52f5d4..7f397663df961b 100644
--- a/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php
+++ b/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face-resolver.php
@@ -5,6 +5,8 @@
* @package WordPress
* @subpackage Fonts
* @since 6.4.0
+ *
+ * @core-merge: this file is located in `wp-includes/fonts/`.
*/
if ( class_exists( 'WP_Font_Face_Resolver' ) ) {
@@ -33,7 +35,7 @@ public static function get_fonts_from_theme_json() {
$settings = gutenberg_get_global_settings();
// Bail out early if there are no font settings.
- if ( empty( $settings['typography'] ) || empty( $settings['typography']['fontFamilies'] ) ) {
+ if ( empty( $settings['typography']['fontFamilies'] ) ) {
return array();
}
diff --git a/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face.php b/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face.php
index 0489fe4f4fbd52..8bb1d55414854f 100644
--- a/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face.php
+++ b/lib/compat/wordpress-6.4/fonts/font-face/class-wp-font-face.php
@@ -5,6 +5,8 @@
* @package WordPress
* @subpackage Fonts
* @since 6.4.0
+ *
+ * @core-merge: this file is located in `wp-includes/fonts/`.
*/
if ( class_exists( 'WP_Font_Face' ) ) {
@@ -82,23 +84,6 @@ class WP_Font_Face {
* @since 6.4.0
*/
public function __construct() {
- /**
- * Filters the font-face property defaults.
- *
- * @since 6.4.0
- *
- * @param array $defaults {
- * An array of required font-face properties and defaults.
- *
- * @type string $provider The provider ID. Default 'local'.
- * @type string $font-family The font-family property. Default empty string.
- * @type string $font-style The font-style property. Default 'normal'.
- * @type string $font-weight The font-weight property. Default '400'.
- * @type string $font-display The font-display property. Default 'fallback'.
- * }
- */
- $this->font_face_property_defaults = apply_filters( 'wp_font_face_property_defaults', $this->font_face_property_defaults );
-
if (
function_exists( 'is_admin' ) && ! is_admin()
&&
@@ -113,7 +98,9 @@ function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5'
*
* @since 6.4.0
*
- * @param array $fonts The fonts to generate and print @font-face styles.
+ * @param array[][] $fonts Optional. The font-families and their font variations.
+ * See {@see wp_print_font_faces()} for the supported fields.
+ * Default empty array.
*/
public function generate_and_print( array $fonts ) {
$fonts = $this->validate_fonts( $fonts );
@@ -123,10 +110,21 @@ public function generate_and_print( array $fonts ) {
return;
}
- printf(
- $this->get_style_element(),
- $this->get_css( $fonts )
- );
+ $css = $this->get_css( $fonts );
+
+ /*
+ * The font-face CSS is contained within and open a
+
+CSS;
+ $this->expectOutputString( $expected_output );
+
+ wp_print_font_faces( $fonts );
+ }
+
public function test_should_print_fonts_in_merged_data() {
switch_theme( static::FONTS_THEME );