forked from WordPress/wordpress-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fonts: Get font-family name from 'fontFamily' field.
Instead of getting the name from the optional `'name'` field, the font-family name now comes from the required `'fontFamily'` field. This change fixes a back-compat (BC) break in how the font-family name is pulled from the incoming font data in the `WP_Font_Face_Resolver`. Why? WP Core does not require the `'name'` field in theme.json. For themes that do not declare it, that set of font variations is ignored, thus causing a BC break from how the stopgap code worked (see [53282]). However, `WP_Theme_JSON` schema does require the `fontFamily` field in each of the `typography.fontFamilies`. == Other details: Includes a parser to extract the first entry when a `fontFamily` field has a comma-separated list of font-families, e.g. `Inter, sans-serif`. References: * Merge from Gutenberg's PR WordPress/gutenberg#54615. Follow-up to [56500], [53282]. Props ironprogrammer, hellofromTonya, mmaattiiaass, pbking. Fixes #59165. git-svn-id: https://develop.svn.wordpress.org/trunk@56688 602fd350-edb4-49c9-b593-d223f7449a82
- Loading branch information
1 parent
4df5cd1
commit 8b63003
Showing
2 changed files
with
136 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters