Font face resolver: print font faces from font families defined in all theme.json origins.

This commit updates the theme.json style generation to allow a font family name to be repeated across theme.json origins (default, theme, custom).

Props mmaattiiaass, hellofromtonya, arthur791004, ironprogrammer.
Fixes #60605.
Built from https://develop.svn.wordpress.org/trunk@57720


git-svn-id: http://core.svn.wordpress.org/trunk@57221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2024-02-27 12:06:10 +00:00
parent 4fbb3d6975
commit e88758878e
3 changed files with 7 additions and 12 deletions

View File

@ -13,13 +13,13 @@
* @since 6.4.0
*
* @param array[][] $fonts {
* Optional. The font-families and their font variations. Default empty array.
* Optional. The font-families and their font faces. Default empty array.
*
* @type string $font-family => array[] $variations {
* Optional. An associated array of font variations for this font-family.
* Each variation has the following structure.
* @type array {
* An indexed or associative (keyed by font-family) array of font variations for this font-family.
* Each font face has the following structure.
*
* @type array $font_variation {
* @type array {
* @type string $font-family The font-family property.
* @type string|string[] $src The URL(s) to each resource containing the font data.
* @type string $font-style Optional. The font-style property. Default 'normal'.

View File

@ -67,12 +67,7 @@ class WP_Font_Face_Resolver {
continue;
}
// Prepare the fonts array structure for this font-family.
if ( ! array_key_exists( $font_family_name, $fonts ) ) {
$fonts[ $font_family_name ] = array();
}
$fonts[ $font_family_name ] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
$fonts[] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name );
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-beta2-57719';
$wp_version = '6.5-beta2-57720';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.