This is an epic ticket to share the ongoing roadmap including:
Updates:
Changed to Font Face: to server-side generate and print fonts' @font-face styles
With the introduction of the new Fonts Library, the role of the Fonts API has significantly changed as noted in #41479 (comment).
Previously, its roles were:
- Role 1: Generate and print the @font-face styles for all “enqueued” fonts.
- Role 2: Provide a means for plugins to present fonts to users, who can then decide whether to use these fonts (i.e. through the Site Editor).
Its new role is:
- Generate and print the @font-face styles for all theme defined and user activated fonts.
Fonts will be presented to users via the Fonts Library, rather than through the Fonts API.
Plugins will no longer interact with the Fonts API. Instead, they will integrate directly into the Font Library (once that capability exists).
Font Face "gets" the fonts to print from Theme JSON merged data layer. Fonts are no longer registered or enqueued directly with it.
A full API is no longer needed. Thus, Font Face replaces the Fonts API.
As part of fonts management and Fonts Library,
This API's job is to provide the backend capabilities to support the "font library" to include font management and dynamic building of the @font-face styles.
The "font library" feature will continue to be built, refined, stabilized, and tuned over multiple WordPress releases.
See #50927.
The idea is to have the concept of a font library on a site to
- manage and catalogue fonts
- and then provide users an interface for them to select which fonts to use in the live site.
The fonts in the library can come from:
- a theme bundling them
- a user uploading fonts they purchased
- a plugin
The fonts to be used in the site are saved and available via Theme JSON merged data layer, i.e. WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_settings().
What about classic sites?
Yes, supported ✅
Classic themes and plugins can have their @font-face styles generated and printed. How?
Classic themes have 2 options:
Plugins supporting classic sites can use Option 1.
⭐ Required for Core introduction:
⭐ Required for Core introduction:
None
⭐ Required for Core introduction:
None
None
Documentation
Backports
Future.
Tracking key
✅ Done
⚪ WIP: work in progress
🟡 Experiment WIP
🍏 in testing or code review
🔴 Danger > immediate action needed
🚫 Blocked
⭐ Needed for WP Core introduction
This is an epic ticket to share the ongoing roadmap including:
Updates:
Changed to Font Face: to server-side generate and print fonts'
@font-facestylesWith the introduction of the new Fonts Library, the role of the Fonts API has significantly changed as noted in #41479 (comment).
Fonts will be presented to users via the Fonts Library, rather than through the Fonts API.
Font Face "gets" the fonts to print from Theme JSON merged data layer. Fonts are no longer registered or enqueued directly with it.
A full API is no longer needed. Thus, Font Face replaces the Fonts API.
Vision
As part of fonts management and Fonts Library,
This API's job is to provide the backend capabilities to support the "font library" to include font management and dynamic building of the
@font-facestyles.The "font library" feature will continue to be built, refined, stabilized, and tuned over multiple WordPress releases.
Font Library
See #50927.
The idea is to have the concept of a font library on a site to
The fonts in the library can come from:
The fonts to be used in the site are saved and available via Theme JSON merged data layer, i.e.
WP_Theme_JSON_Resolver_Gutenberg::get_merged_data()->get_settings().FAQ
What about classic sites?
Yes, supported ✅
Classic themes and plugins can have their
@font-facestyles generated and printed. How?Classic themes have 2 options:
'wp_head'and'admin_print_styles'and within that callback function, invoke a new print method and pass their fonts to it.theme.jsonfile that only defines the fonts. See issue [Fonts API] Proposal: classic themes define fonts in a theme.json file #51714 for more information.Plugins supporting classic sites can use Option 1.
Ongoing work
Architecture
⭐ Required for Core introduction:
Performance
⭐ Required for Core introduction:
None
Feature needs
⭐ Required for Core introduction:
None
Future enhancements
Bugs
None
Documentation
fontFaceand it’s values intheme.jsonschema #41844 ⚪Backports
Future.
Tracking key
✅ Done
⚪ WIP: work in progress
🟡 Experiment WIP
🍏 in testing or code review
🔴 Danger > immediate action needed
🚫 Blocked
⭐ Needed for WP Core introduction