Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #59165


Ignore:
Timestamp:
08/22/2023 01:48:53 PM (3 months ago)
Author:
hellofromTonya
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59165

    • Property Owner set to hellofromTonya
    • Property Status changed from new to accepted
  • Ticket #59165 – Description

    initial v2  
    3030Yes. Font Face is a direct replacement for the stopgap code in `_wp_theme_json_webfonts_handler()` that was introduced in 6.0 via [53282].
    3131
     32== Is it built-off of Fonts API?
     33
     34Font Face is built off of the early versions of a Web Fonts API that was first proposed in #46370. The internal CSS generation and printing comes from that early version.
     35
     36It does not include register, deregister, enqueue, or custom provider functionality.
     37
     38== Why no register or enqueue?
     39
     40The earlier versions of a web font API went through many implementations to fit what was known in each's time. It involved from Webfonts API to Web Fonts API to Fonts API. Each of these APIs provided the means for themes and plugins to register fonts with it, these registered fonts were injected into Theme JSON theme data layer for presentation to the user for selection. And then user selected fonts and theme defined fonts were enqueued and printed.
     41
     42The role of registration existed for the purpose of making fonts available for users to globally select what they want on their website. Then those selections were enqueued for style generation and printing.
     43
     44But problems happened with a low level service trying to inject fonts into higher data levels. A low level service should not be involved in the process of determining what fonts are being used and should be generated and printed. Rather, a low level service should be told "Hey, process these fonts."
     45
     46[https://github.com/WordPress/gutenberg/issues/52698 The Font Library] changed the direction as its role is to present fonts to users for them to manage what fonts they want on their website. Users will be able to upload / install, activate, and deactivate fonts. Those selections will then be saved for the system to use, including Font Face.
     47
     48== Is it an API?
     49
     50No. Other components and APIs will not interact with it, per se. Rather, it receives or gets what it needs to do its job.
     51
    3252== References:
    3353* #46370 original (Web)Fonts API proposal for registering and enqueuing web fonts.