[wp-trac] [WordPress Trac] #59165: Font Face: Server-side @font-face styles generator and printer

WordPress Trac noreply at wordpress.org
Thu Sep 7 17:29:15 UTC 2023


#59165: Font Face: Server-side @font-face styles generator and printer
-------------------------------------------------+-------------------------
 Reporter:  hellofromTonya                       |       Owner:
                                                 |  hellofromTonya
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.4
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  gutenberg-merge needs-dev-note has-  |     Focuses:
  patch has-unit-tests has-testing-info has-     |
  screenshots                                    |
-------------------------------------------------+-------------------------
Changes (by hellofromTonya):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"56540" 56540]:
 {{{
 #!CommitTicketReference repository="" revision="56540"
 Fonts: Removes static instance in wp_print_font_faces().

 The static instance of `WP_Font_Face` is not needed. It was an unnecessary
 carryover from the experimental Fonts API (which was not introduced into
 Core).

 Whereas the Fonts API needed to persist its data (i.e. to maintain the
 registered and enqueued fonts throughout the web request), Font Face does
 not have data to persist.

 Font Face processes the fonts it receives when
 `WP_Font_Face::generate_and_print( $fonts )` is invoked. Thus, a singleton
 is not needed.

 Removing the static reduces the amount of the code in the function and
 eliminates running its tests in separate processes to ensure a different
 instance is always used.

 References:
 * [https://github.com/WordPress/gutenberg/pull/54228 Gutenberg PR 54228].

 Follow-up to [56500].

 Props hellofromTonya, costdev.
 Fixes #59165.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59165#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list