Skip to content

Server-Side Font Face CSS Generation and Printing: Ongoing Roadmap (formerly the Fonts API) #41479

@hellofromtonya

Description

@hellofromtonya

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.

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-face styles.

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

  • 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().

FAQ

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.

Ongoing work

Architecture

⭐ Required for Core introduction:

Performance

⭐ Required for Core introduction:
None

Feature needs

⭐ Required for Core introduction:
None

Future enhancements

  • Add font management UI to Customizer for classic themes

Bugs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Font Library[Feature] TypographyFont and typography-related issues and PRs[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issues[Type] Tracking IssueTactical breakdown of efforts across the codebase and/or tied to Overview issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions