Make WordPress Core

Opened 9 months ago

Closed 3 months ago

Last modified 3 months ago

#59166 closed enhancement (fixed)

Font Library: Font manager for WordPress

Reported by: mmaattiiaass's profile mmaattiiaass Owned by: mikachan's profile mikachan
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Editor Keywords: gutenberg-merge needs-dev-note has-patch has-unit-tests
Focuses: Cc:

Description (last modified by ironprogrammer)

Introducing the Font Library, a font manager for WordPress.

This ticket is for tracking the merge of the Font Library from Gutenberg into Core.

What is the Font Library?

Font Library is a font manager for WordPress, similar to the Media Library. It provides a user interface and workflow experience for users to manage the fonts they want on globally used on their website.

It will be available globally, independently of the theme activated.

The list of installed fonts and their assets are site-wide available and the users can select the fonts activated (available in the editor) for each theme.

Using the Font Library users can:

  • Install fonts
    • Install local fonts
    • Install Google fonts
  • Activate/deactivate fonts
  • Uninstall fonts

How it works:

  • Install fonts: add the font family definition to the installed fonts. List and download the font face assets to /wp-content/fonts/ (see GB 54122).
    • Install local fonts: The font assets are uploaded from the users devices to the /wp-content/fonts/ folder and the font definitions are added to the list of installed fonts.
    • Install Google fonts: add the font families definition to the list and downloads the Google fonts assets to /wp-content/fonts/. The assets from Google are called just at the time of previewing fonts in the Font Library. After the fonts is installed no other request to Google or other third-party servers will be made because the font assets are hosted locally in the /wp-content/fonts/ folder.
  • Activate/deactivate fonts: add/remove font-family definitions from the font families list defined in Global Styles/Settings. The active fonts are the fonts that will be available to use in the editor. As we are using the Global Styles data the users are able to activate/deactivate fonts for each theme.
  • Uninstall fonts: remove the font family definition from the list of installed fonts and delete the assets from /wp-content/fonts/ folder. Only the non-active fonts from the user-installed fonts can be uninstalled. Theme fonts will be able to be deactivated but not uninstalled.

References:

Change History (72)

#1 @ironprogrammer
8 months ago

  • Description modified (diff)

This ticket was mentioned in PR #5190 on WordPress/wordpress-develop by @ironprogrammer.


8 months ago
#2

  • Keywords has-patch added

Adds the src/wp-content/fonts folder to .gitignore, treating it like the plugins or uploads folder. The font upload storage location was most recently updated in https://github.com/WordPress/gutenberg/pull/54122.

Trac ticket: https://core.trac.wordpress.org/ticket/59166

This ticket was mentioned in PR #5285 on WordPress/wordpress-develop by @mmaattiiaass.


8 months ago
#3

  • Keywords has-unit-tests added

#4 @hellofromTonya
8 months ago

  • Type changed from enhancement to task (blessed)

Converting this ticket into "blessed". Why?

The Font Library is a major feature planned for 6.4. It's included in Gutenberg 16.7. I've been deeply involved in its development cycle.

I think it's safe to move this feature into "blessed", giving it time for refinement and testing with the goal of shipping in 6.4. That said, I'll monitor it closely through the beta cycle.

@mmaattiiaass commented on PR #5285:


8 months ago
#5

Added 52 contributors as co-authors of this commit so they become co-authors the this entire PR when is merged.

This is the list of github usernames:

    andrewserong
    anton-vlasenko
    annezazu
    azaozz
    bph
    ciampo
    colorful-tones
    costdev
    DAreRodz
    dcalhoun
    derekblank
    felixarntz
    getdave
    glendaviesnz
    gutenbergplugin
    gziolo
    hellofromtonya
    iqbalpb
    ironprogrammer
    jameskoster
    jasmussen
    jeffikus
    jffng
    jordesign
    krokodok
    LittleBigThing
    luisherranz
    madhusudhand
    Mamaduka
    margolisj
    matiasbenedetto
    mikachan
    mtias
    ntsekouras
    oandregal
    ocean90
    ockham
    paaljoachim
    pbking
    priethor
    properlypurple
    ramonjd
    Ren2049
    richtabor
    spacedmonkey
    t-hamano
    TimothyBJacobs
    tomoxygen
    vcanales
    walbo
    webd-uk
    youknowriad

Compiled from 110 related PRs and issues:
<details>
<summary>
(PRs and issues containing: "Font Library", "Fonts Library" or "Font Manager" in the title"):</summary>

Pull Request: Font Library: unregister font collection
https://github.com/WordPress/gutenberg/pull/54701

Issue: Font Library: unregister font collection
https://github.com/WordPress/gutenberg/issues/54697

Pull Request: Font Library: Fix error installing system fonts
https://github.com/WordPress/gutenberg/pull/54713

Issue: Font Library
https://github.com/WordPress/gutenberg/issues/54169

Pull Request: Font Library: adding docs
https://github.com/WordPress/gutenberg/pull/54477

Issue: Font Library: .otf font files are rejected.
https://github.com/WordPress/gutenberg/issues/54759

Pull Request: Font library: lib-font as npm dependency
https://github.com/WordPress/gutenberg/pull/54440

Issue: Font Library: fix endpoint permissions
https://github.com/WordPress/gutenberg/issues/54751

Pull Request: Drop support for otf font installation in font library
https://github.com/WordPress/gutenberg/pull/54780

Pull Request: Font Library: move font uploads to a new tab
https://github.com/WordPress/gutenberg/pull/54655

Issue: Font Library: Export fonts on theme export
https://github.com/WordPress/gutenberg/issues/54226

Issue: [Tracking] Font Library. Stage 2: Fonts Library extensions
https://github.com/WordPress/gutenberg/issues/53307

Pull Request: Font Library: Fix set upload dir test
https://github.com/WordPress/gutenberg/pull/54762

Pull Request: Font Library: Frontend
https://github.com/WordPress/gutenberg/pull/53650

Issue: Font Library: add progress-bar while uploading font assets
https://github.com/WordPress/gutenberg/issues/54399

Issue: Font Library: Uninstall modal text is redundant
https://github.com/WordPress/gutenberg/issues/54528

Issue: Font Library: should it include a 'featured' font category to list featured fonts as default view?
https://github.com/WordPress/gutenberg/issues/54671

Issue: Font Library: include a system fonts collection by default.
https://github.com/WordPress/gutenberg/issues/54186

Issue: Font Library: show the scrollbar bottom edge
https://github.com/WordPress/gutenberg/issues/54401

Pull Request: Font Library: remove font files created by tests after tests run
https://github.com/WordPress/gutenberg/pull/54771

Issue: Font Library: How to add lib-font package (or equivalent).
https://github.com/WordPress/gutenberg/issues/53653

Issue: Font Library: Automatically switch to installed tab after successful upload of fonts.
https://github.com/WordPress/gutenberg/issues/54779

Issue: Font Library: No message appears when pressing the Update button
https://github.com/WordPress/gutenberg/issues/54601

Issue: Font Library:  A border is drawn when there are no fonts available
https://github.com/WordPress/gutenberg/issues/54527

Issue: Font Library: replace snackbar error notices with new component
https://github.com/WordPress/gutenberg/issues/54504

Issue: Font Library: maintain focus order within nested modal
https://github.com/WordPress/gutenberg/issues/54431

Issue: [Tracking] Font Library. Stage 1: Manage fonts and Local fonts upload
https://github.com/WordPress/gutenberg/issues/52698

Issue: Font Library and Global Style revisions: inconsistencies around deleted font assets.
https://github.com/WordPress/gutenberg/issues/54222

Issue: [Tracking] Font Library. Stage 3: UI, UX and performance improvements
https://github.com/WordPress/gutenberg/issues/53926

Issue: [Fonts API] Remove all files once Font Library is merged
https://github.com/WordPress/gutenberg/issues/51820

Issue: Font library: add support for detailed error messaging in API and UI
https://github.com/WordPress/gutenberg/issues/54777

Issue: Font Picker: Refine, show font preview, and load only active fonts from library
https://github.com/WordPress/gutenberg/issues/51151

Issue: Font Library: Some SVG image previes are clipped or not rendered legibly
https://github.com/WordPress/gutenberg/issues/54688

Pull Request: Move the switch to enable new Font Library to Experiments setting
https://github.com/WordPress/gutenberg/pull/54315

Pull Request: Font Library: Font Collections frontend
https://github.com/WordPress/gutenberg/pull/54566

Pull Request: Font Library: fix space above theme fonts in font library modal
https://github.com/WordPress/gutenberg/pull/54598

Pull Request: Fix Font library unit tests
https://github.com/WordPress/gutenberg/pull/54645

Pull Request: Font Library: Refactor logic to disable font library in the frontend.
https://github.com/WordPress/gutenberg/pull/54748

Pull Request: Font Library: use resolvable domain in test
https://github.com/WordPress/gutenberg/pull/54763

Pull Request: Font Library: remove upload_mimes filter after uploading fonts
https://github.com/WordPress/gutenberg/pull/54647

Pull Request: Font Library: fix duplicate variants
https://github.com/WordPress/gutenberg/pull/54320

Pull Request: Font Library: Font Collection backend
https://github.com/WordPress/gutenberg/pull/54098

Issue: Rename "Fonts Library" to "Font Library"
https://github.com/WordPress/gutenberg/issues/53778

Pull Request: Font Library: Font Collection backend 
https://github.com/WordPress/gutenberg/pull/54097

Pull Request: Renames "Fonts Library" to "Font Library"
https://github.com/WordPress/gutenberg/pull/53780

Issue: Font Library: Errors may occur with custom font-related actions
https://github.com/WordPress/gutenberg/issues/54529

Pull Request: Font library: load font assets on editor canvas
https://github.com/WordPress/gutenberg/pull/54334

Pull Request: Font Library: Font Collection backend
https://github.com/WordPress/gutenberg/pull/53816

Pull Request: Font Library: use wporg cdn to host the google fonts json data
https://github.com/WordPress/gutenberg/pull/54795

Pull Request: Font Library: changing the upload directory to wp-content/fonts
https://github.com/WordPress/gutenberg/pull/54122

Pull Request: Font Library: Frontend [Stage 1]
https://github.com/WordPress/gutenberg/pull/53884

Pull Request: Font Library: add more e2e tests
https://github.com/WordPress/gutenberg/pull/54298

Pull Request: Font Library: add mime type validation for font uploads
https://github.com/WordPress/gutenberg/pull/53986

Pull Request: Fonts Library: Test improvements
https://github.com/WordPress/gutenberg/pull/53702

Issue: [Font Library] Frontend: Load font collections in the frontend
https://github.com/WordPress/gutenberg/issues/54040

Issue: [Font Library] Frontend: Load SVG previews instead of font files
https://github.com/WordPress/gutenberg/issues/54039

Issue: Font Library: replace font preview URLs from provosional to wporg CDN URLs
https://github.com/WordPress/gutenberg/issues/54685

Pull Request: Font Library: fix modal width on mobile viewport
https://github.com/WordPress/gutenberg/pull/54518

Pull Request: Font Library: setting wp_font_family custom post type as _builtin and not plublic
https://github.com/WordPress/gutenberg/pull/54559

Pull Request: Font Library: Fix notification error for actions related to custom fonts
https://github.com/WordPress/gutenberg/pull/54535

Issue: Font Library: Has extra space in the modal when there are no installed fonts.
https://github.com/WordPress/gutenberg/issues/54592

Pull Request: Fonts Library: change upload directory to wp-content/fonts
https://github.com/WordPress/gutenberg/pull/54076

Pull Request: Font Library: fix duplicate variants with different file types
https://github.com/WordPress/gutenberg/pull/54490

Issue: Query Loop: "Font Library" appears in the post type dropdown
https://github.com/WordPress/gutenberg/issues/54526

Pull Request: Fonts Library: Backend
https://github.com/WordPress/gutenberg/pull/52704

Issue: Font Library: use /wp-content/fonts instead of /wp-content/uploads/fonts to store font assets.
https://github.com/WordPress/gutenberg/issues/53965

Issue: Font Library: Same font faces with different file extensions are added as a separated variant. 
https://github.com/WordPress/gutenberg/issues/54253

Issue: [Font Library] Google fonts collection: generate SVG previews and add them to the list
https://github.com/WordPress/gutenberg/issues/54038

Pull Request: Relocates Font Face and Fonts Library PHP files into Core's fonts directory
https://github.com/WordPress/gutenberg/pull/53747

Issue: Font Library: where to store the list of Google Fonts?
https://github.com/WordPress/gutenberg/issues/52795

Issue: Font Library: load collection data from a URL
https://github.com/WordPress/gutenberg/issues/53992

Pull Request: Font Face & Font Library: Load PHP files only if the main class does not exist.
https://github.com/WordPress/gutenberg/pull/54103

Pull Request: Font Library
https://github.com/WordPress/gutenberg/pull/50927

Issue: Font Library: Add a disclaimer/notice saying the fonts will be downloaded from third-party sources.
https://github.com/WordPress/gutenberg/issues/53882

Pull Request: Font Library: ensure merged fontFace data is enconded as an array instead of an object
https://github.com/WordPress/gutenberg/pull/54435

Pull Request: Font Library: load collection JSON data from a URL in the collection config
https://github.com/WordPress/gutenberg/pull/54067

Pull Request: Try disabling FONT_LIBRARY_ENABLE in PHP tests now that the lib is in Core
https://github.com/WordPress/gutenberg/pull/54102

Issue: Font Library backend: can we use _wp_handle_upload() mime type validation ?
https://github.com/WordPress/gutenberg/issues/53576

Pull Request: Fonts Library: update properties name from snake case to camel case to match the rest of the properties
https://github.com/WordPress/gutenberg/pull/53746

Pull Request: [Block Library]: Remove font family support from 5.9 blocks
https://github.com/WordPress/gutenberg/pull/37911

Pull Request: Font Library: Fix error installing system fonts
https://github.com/WordPress/gutenberg/pull/54713

Issue: Font Library: Export fonts on theme export
https://github.com/WordPress/gutenberg/issues/54226

Issue: [Tracking] Font Library. Stage 2: Fonts Library extensions
https://github.com/WordPress/gutenberg/issues/53307

Issue: Font Library: include a system fonts collection by default.
https://github.com/WordPress/gutenberg/issues/54186

Issue: [Tracking] Font Library. Stage 1: Manage fonts and Local fonts upload
https://github.com/WordPress/gutenberg/issues/52698

Issue: Font Library: Automatically switch to installed tab after successful upload of fonts.
https://github.com/WordPress/gutenberg/issues/54779

Issue: Font Library: should it include a 'featured' font category to list featured fonts as default view?
https://github.com/WordPress/gutenberg/issues/54671

Issue: Font Library:  A border is drawn when there are no fonts available
https://github.com/WordPress/gutenberg/issues/54527

Issue: [Fonts API] Remove all files once Font Library is merged
https://github.com/WordPress/gutenberg/issues/51820

Issue: Font Picker: Refine, show font preview, and load only active fonts from library
https://github.com/WordPress/gutenberg/issues/51151

Issue: Rename "Fonts Library" to "Font Library"
https://github.com/WordPress/gutenberg/issues/53778

Pull Request: Fonts Library: Test improvements
https://github.com/WordPress/gutenberg/pull/53702

Pull Request: Font Library: remove upload_mimes filter after uploading fonts
https://github.com/WordPress/gutenberg/pull/54647

Pull Request: Renames "Fonts Library" to "Font Library"
https://github.com/WordPress/gutenberg/pull/53780

Pull Request: Fonts Library: change upload directory to wp-content/fonts
https://github.com/WordPress/gutenberg/pull/54076

Pull Request: Font Library: fix space above theme fonts in font library modal
https://github.com/WordPress/gutenberg/pull/54598

Pull Request: Fonts Library: Backend
https://github.com/WordPress/gutenberg/pull/52704

Pull Request: Font Library: changing the upload directory to wp-content/fonts
https://github.com/WordPress/gutenberg/pull/54122

Pull Request: Font Library: use wporg cdn to host the google fonts json data
https://github.com/WordPress/gutenberg/pull/54795

Issue: Font Library: Has extra space in the modal when there are no installed fonts.
https://github.com/WordPress/gutenberg/issues/54592

Pull Request: Font Library: Fix notification error for actions related to custom fonts
https://github.com/WordPress/gutenberg/pull/54535

Issue: Font Library: use /wp-content/fonts instead of /wp-content/uploads/fonts to store font assets.
https://github.com/WordPress/gutenberg/issues/53965

Pull Request: Relocates Font Face and Fonts Library PHP files into Core's fonts directory
https://github.com/WordPress/gutenberg/pull/53747

Issue: Font Library: where to store the list of Google Fonts?
https://github.com/WordPress/gutenberg/issues/52795

Issue: [Font Library] Google fonts collection: generate SVG previews and add them to the list
https://github.com/WordPress/gutenberg/issues/54038

Issue: Font Library: Add a disclaimer/notice saying the fonts will be downloaded from third-party sources.
https://github.com/WordPress/gutenberg/issues/53882

Pull Request: Fonts Library: update properties name from snake case to camel case to match the rest of the properties
https://github.com/WordPress/gutenberg/pull/53746

Issue: Fonts Manager: inconsistent results for installed fonts
https://github.com/WordPress/gutenberg/issues/54568

Pull Request: Font manager
https://github.com/WordPress/gutenberg/pull/46332

Issue: Extra spacing in Font manager
https://github.com/WordPress/gutenberg/issues/54649

</details>

@mmaattiiaass commented on PR #5285:


8 months ago
#6

All the comments were addressed on the latest commits. Coul you please, give it another review @spacedmonkey @hellofromtonya ?

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


8 months ago

@mmaattiiaass commented on PR #5285:


8 months ago
#8

I find the REST API structure/design here very confusing.
I don't understand why we have a separate font families endpoint that is going to end up with a very different shape from the fonts endpoint.

The custom POST /fonts and DELETE /fonts endpoints are for installing and uninstalling several font families at once.
The default wp_font_family endpoint is to fetch the font families post from the frontend.

Is this what you are asking @TimothyBJacobs ?

@TimothyBlynJacobs commented on PR #5285:


8 months ago
#9

The custom POST /fonts and DELETE /fonts endpoints are for installing and uninstalling several font families at once.

Not exactly, for deleting or creating multiple font families at once, the /v1/batch endpoint should be used. Making the endpoints themselves batched is not how Core REST API endpoints are designed.

The default wp_font_family endpoint is to fetch the font families post from the frontend.

Why isn't this done through the main fonts endpoint?

@mmaattiiaass commented on PR #5285:


8 months ago
#10

Not exactly, for deleting or creating multiple font families at once, the /v1/batch endpoint should be used

Do think this functionality is able to do the tasks that the install endpoint does?

  • Conditional (based on the existence of that font family in the database) creating and/or updating wp_font_family posts.
  • Upload/download assets and handle errors (this conditions the what (if any) post_content should be written for each post.

@spacedmonkey commented on PR #5285:


8 months ago
#11

+1 to comments about the rest api. Feedback needs to be actioned before commit.

@hellofromTonya commented on PR #5285:


8 months ago
#12

FYI: There's a discussion happening in Make/Core's slack REST API channel starting here https://wordpress.slack.com/archives/C02RQC26G/p1696280573385409.

@hellofromTonya commented on PR #5285:


8 months ago
#13

Update:

Thank you everyone for all sharing your expertise and time in reviewing, advising, and helping to get this feature ready 🙇‍♀️

Current status:

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


8 months ago

@mmaattiiaass commented on PR #5285:


8 months ago
#15

:wave: Thank you all so much for the feedback and reviews.
This is an update about the current status of the biggest concerns about this PR:

  • Consolidate endpoint routes ✅
  • Make endpoints singular (understand one font family per request) ✅
  • Add response schemas ✅
  • Group endpoints registering ✅
  • Update the unit tests (90% done)
  • Make ALL data input and output from endpoints snake_case instead of camelCase. (50% done).

These are all the endpoints added:

Font families:

POST /font-families/
DELETE /fonts-families/<slug>
GET /fonts-families
GET /fonts-families/<slug>

Font collections:

GET /fonts-collections
GET /fonts-collections/<slug>

Could you please take a new look?

@spacedmonkey commented on PR #5285:


8 months ago
#16

@matiasbenedetto My review was requested. Please ensure before requesting my reviewing the following things are complete, before I review.

  • All unit tests are pass.
  • PHPCS coding standards pass.
  • All feedback has been actioned.

@hellofromTonya commented on PR #5285:


8 months ago
#17

Sharing @spacedmonkey observations from Make/Core slack in the #core channel:

I am currently reviewing the font apis PR . I must say, I am very worried about the PR in it's current state. The code simply doesn't follow the WP core code style and doesn't feel WordPress. I have a number of problems with it, including.

  • Limited developer API. We need function like wp_insert_font / wp_create_font etc.
  • Lack of filter or actions.
  • No way to unregister font collections.
  • Capabilities. Creating new fonts should have capabilies and not simply map to edit_theme_options
  • Confusing API structure. Collection should have embedded font objects
  • What happens to fonts when collections are unregistered.
  • If fonts are stored as post object, can I query to get all fonts from a collection.
  • Are fonts deleted when the user is deleted.
  • No way to filter where a font is stored. ( #hosting channel for detail ).

With time very limited in this release, it feels like actioning the above, feel like it is going too hard to achieve in this release.

I think this feature needs some more time to bake.

No way to filter where a font is stored.

See https://github.com/WordPress/gutenberg/issues/54697 to add WP_FONTS_DIR constant to unblock web hosts.

No way to unregister font collections.

https://github.com/WordPress/gutenberg/issues/54697

#18 @hellofromTonya
8 months ago

  • Keywords changes-requested added
  • Milestone changed from 6.4 to 6.5
  • Type changed from task (blessed) to enhancement

The feature is not yet ready and needs more time.

An open thoughtful discussion happened today in Make/Core slack to discuss its needs and if the feature should or shouldn't stay in 6.4.

It was determined that the feature is not a dependency for other features in the release, including TT4 and the Editor.

Quoting Josepha @chanthaboune

Alright, my friends. I think the only right choice here is to punt Fonts to WP6.5.

Moving it to 6.5 gives the feature more time for Gutenberg and Core folks to continue working on the REST API, control mechanisms, etc. while also giving more time for testing and feedback through Gutenberg release cycles.

Thank you to everyone how has been contributing to it thus far.

It's an awesome feature. It will ship.

@mmaattiiaass commented on PR #5285:


7 months ago
#19

Closing this PR due to the inclusion of this feature was punted to 6.5:
https://wordpress.slack.com/archives/C02RQBWTW/p1696525101347939

@mmaattiiaass commented on PR #5285:


7 months ago
#20

Tracking the required changes to make Font Library ready for 6.5 in this Gutenberg issue: https://github.com/WordPress/gutenberg/issues/54169

#21 @mikachan
4 months ago

👋 Noting that there is a new API design proposal for the Font Library here: https://github.com/WordPress/gutenberg/issues/57616.

We're planning on implementing this over the next few weeks so it can be released with Gutenberg 17.6 (we're aiming to merge by January 23). After that, we'll start the work to merge it into Core for 6.5. We'd appreciate any feedback. Thanks everyone!

#22 @mikachan
4 months ago

Posting an update for the continued work on the Font Library:

It would still be great to have more feedback on the REST API. The proposed design has been implemented in this feature branch, so this would be the best place to review.

Once the API changes have been merged into Gutenberg, we can then update the docs and start looking at the items listed in the "nice to have" list on the tracking issue.

#23 @hellofromTonya
4 months ago

As Font Library is progressing forward and planned for 6.5, it's time to reshare the Core merge criteria for broad awareness, tracking, and discussion.

Here are the criteria set during 6.4:

  • shared during Alpha:

    The criteria for merging into Core has been:

    1. The feature has already shipped in the Gutenberg plugin.
    2. It's been at least 1 week after it shipped in the plugin, i.e. to give time for feedback and testing in case there are major issues that will cause rework of the feature.
  • shared during Beta:

    When could it committed into Core?
    Expectations: Redesign gets done, ships (in the plugin), and is approved by one of the Core REST API maintainers.

Combining those expectations together and after discussions in DevChat and with the REST API maintainers, the Core merge criteria:

  • Font Library's REST API design was reviewed and guided by one of the REST API maintainers during development.
  • The feature was already released in the Gutenberg plugin and is running as default enabled in the plugin with no major issues.
  • All the above was done before 6.5 Beta 1.

The Font Library went into 6.4's beta cycle without a Core commit. For 6.5, I'd suggest returning to the typical workflow of new feature being committed or punted before or by Beta 1.

Thoughts? Did I miss anything? Is there agreement on the criteria?

Last edited 4 months ago by hellofromTonya (previous) (diff)

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


4 months ago

#25 @hellofromTonya
4 months ago

  • Owner changed from hellofromTonya to mikachan

Switching owner to @mikachan, who is more "in-the-know" than I am and is (and has been) shepherding the development work in Gutenberg.

#26 @mikachan
4 months ago

Latest update:

The API refactor is due to be released with Gutenberg 17.6 RC on January 24, and full release on January 31.

We continue to welcome feedback and testing and will iterate further in Gutenberg trunk. We're planning to open a new patch for Core with the API refactor soon.

#27 @mikachan
4 months ago

Another update:

  • We have made further smaller changes to the Font Library (both PHP and JS) over the past week, ready to be released with Gutenberg 17.6.
  • We plan to open 2 PRs for Core:
    1. General PHP: Custom post type registration, Font Library, Font Collection classes and functions
    2. REST API controllers
  • The preparation for those is happening now, and we hope to have a further update by the end of this week (Feb 2).

If you'd like to follow along, all the work in Gutenberg is labeled with [Feature] Font Library.

This ticket was mentioned in Slack in #core by ironprogrammer. View the logs.


4 months ago

This ticket was mentioned in Slack in #accessibility by joesimpsonjr. View the logs.


4 months ago

This ticket was mentioned in PR #6026 on WordPress/wordpress-develop by @youknowriad.


3 months ago
#30

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

@get_dave commented on PR #6026:


3 months ago
#31

PHPCS errors are mainly tabs vs spaces. Should be simple to clean up.

@youknowriad commented on PR #6026:


3 months ago
#32

Actually, it looks like I opened a PR on the wrong repo (core instead of my own fork) I'm going to close this one and open a new PR soon.

This ticket was mentioned in PR #6027 on WordPress/wordpress-develop by @youknowriad.


3 months ago
#34

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

This ticket was mentioned in PR #6027 on WordPress/wordpress-develop by @youknowriad.


3 months ago
#33

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

@youknowriad commented on PR #6026:


3 months ago
#34

Closing in favor of #6027

@get_dave commented on PR #6027:


3 months ago
#35

e2e tests are failing on await requestUtils.activatePlugin( 'gutenberg' );.

@youknowriad commented on PR #6027:


3 months ago
#36

@getdave Yes, that means this PR conflicts with the latest Gutenberg, it means we probably need to bring these changes to the latest Gutenberg version and do a patch release of Gutenberg before committing this PR to Core. But it doesn't prevent this PR from being reviewed properly.

@youknowriad commented on PR #6027:


3 months ago
#37

With the latest Gutenberg release, this PR passes all the tests now 🎉

@get_dave commented on PR #6027:


3 months ago
#38

Note also some fixes will be coming in here as soon as https://github.com/WordPress/gutenberg/pull/58675 is in Gutenberg.

@get_dave commented on PR #6027:


3 months ago
#39

I've applied the fixes from https://github.com/WordPress/gutenberg/pull/58675/.

Ideally should aim to do one final PR upstream in Gutenberg repo to resolve all outstanding review comments here.

@get_dave commented on PR #6027:


3 months ago
#40

More feedback being addressed in Gutenberg at https://github.com/WordPress/gutenberg/pull/58691.

@grantmkin commented on PR #6027:


3 months ago
#41

The changes from https://github.com/WordPress/gutenberg/pull/58691, addressing changes requested in review comments here, have now been applied to this PR.

#42 @hellofromTonya
3 months ago

  • Keywords commit added; changes-requested removed

Patch: https://github.com/WordPress/wordpress-develop/pull/6027

From the PR:

  • All feedback in this PR is addressed and, if required, code changes made. ✅

LGTM 👍

IMO it's ready for commit.

Marking the patch for commit. But suggest waiting at least 12 hours to give folks time. If no blockers or additional actions needed, then should be ready for commit.

#43 @youknowriad
3 months ago

In 57539:

Editor: Introduce the Font Library post types and low level APIs.

This is the first step towards adding the font library to WordPress.
This commit includes the font library and font face CPTs.
It also adds the necessary APIs and classes to register and manipulate font collections.

This PR backports the font library post types and low level APIs to Core. This is the first step to include the font library entirely into Core. Once this merged, we'll open a PR with the necessary REST API controllers.

Props youknowriad, get_dave, grantmkin, swissspidy, hellofromtonya, mukesh27, mcsf.
See #59166.

@youknowriad commented on PR #6027:


3 months ago
#44

Commit here https://core.trac.wordpress.org/changeset/57539
I'll be opening a follow-up PR with the REST controllers shortly.

This ticket was mentioned in PR #6034 on WordPress/wordpress-develop by @youknowriad.


3 months ago
#45

Trac ticket: https://core.trac.wordpress.org/ticket/59166

This builds on top of the initial Font Library API PR and adds the necessary REST API controllers to make the Font Library work properly.

### Testing instructions

  • You can add the following piece of code anywhere
function gutenberg_register_font_collections() {
	wp_register_font_collection( 'google-fonts', 'https://raw.githubusercontent.com/WordPress/google-fonts-to-wordpress-collection/01aa57731575bd13f9db8d86ab80a2d74e28a1ac/releases/gutenberg-17.6/collections/google-fonts-with-preview.json' );
}
add_action( 'init', 'gutenberg_register_font_collections' );
  • Go to the site editor
  • Open the global styles panel
  • Open typography
  • Click on the "Aa" icon to open the font library
  • On the third panel, you should be able to enable google fonts and use them properly.

@youknowriad commented on PR #6034:


3 months ago
#47

Working on fixing the unit tests.

@swissspidy commented on PR #6034:


3 months ago
#48

@youknowriad In #6027 it was mentioned that \WP_Font_Utils::get_allowed_font_mime_types() (which so far is only used in tests) is needed for the REST API. But I don't see it being used here at all. What am I missing?

#49 @youknowriad
3 months ago

In 57540:

Editor: Fix Font Library PHP unit tests.

These font assets files used in phpunit tests were missing in the original commit [57539].

Props mukesh27.
See #59166.

@youknowriad commented on PR #6034:


3 months ago
#51

Anyone knows how to regenerate the wp-api-generated.js fixture?

@ocean90 commented on PR #6034:


3 months ago
#52

Anyone knows how to regenerate the wp-api-generated.js fixture?

Try running:

npm run test:php -- --filter test_build_wp_api_client_fixtures

or:

npm run test:php -- --filter WP_Test_REST_Schema_Initialization

#53 @swissspidy
3 months ago

In 57541:

Coding Standards: Fix array key alignment after [57539].

See #59166.

@youknowriad commented on PR #6034:


3 months ago
#54

@ocean90 Both of these options return a different version of that file 🤷 Not sure what I'm doing wrong.

#55 @hellofromTonya
3 months ago

  • Keywords commit removed

With the non-REST portion committed, resetting commit keyword.

@youknowriad commented on PR #6034:


3 months ago
#56

Looks like all the feedback have been addressed here. I'll be committing this shortly if there's no other blocker.

#57 @youknowriad
3 months ago

In 57548:

REST API: Introduce the necessary endpoints for the font library.

This commits add three endpoints to retrieve and manipulate fonts in WordPress.
This commit also means that we now have a fully functional Font Library in the site editor.

Props get_dave, youknowriad, mmaattiiaass, grantmkin, swissspidy, mcsf, jorbin, ocean90.
See #59166.

#59 @youknowriad
3 months ago

I'm leaving this ticket open because we're missing a small piece which is the registration of the Google font collection. I'm going to follow-up quickly with a PR to address it.

This ticket was mentioned in PR #6056 on WordPress/wordpress-develop by @youknowriad.


3 months ago
#60

Trac ticket: https://core.trac.wordpress.org/ticket/59166

This PR register the google fonts collection allowing users to install Google Fonts if they wish to.

### Testing instructions

  • Go to the site editor
  • Open the global styles panel
  • Open typography
  • Click on the "Aa" icon to open the font library
  • On the third panel, you should be able to enable google fonts and install them properly.

https://i0.wp.com/github.com/WordPress/wordpress-develop/assets/272444/cbf39608-8bc6-4cad-975f-c171fd1d8aae

#61 @kebbet
3 months ago

[57539] introduced a typo in the docblock for sanitize_from_schema on line 144 in class-wp-font-utils.php
Link to line

santized should be sanitized.

Last edited 3 months ago by kebbet (previous) (diff)

This ticket was mentioned in PR #6058 on WordPress/wordpress-develop by @kebbet.


3 months ago
#62

[r57539] introduced a typo in the docblock for sanitize_from_schema on line 144 in class-wp-font-utils.php
Link to line

santized should be sanitized.

https://core.trac.wordpress.org/ticket/59166
https://core.trac.wordpress.org/ticket/59651

@youknowriad commented on PR #6058:


3 months ago
#63

Thanks for the fix. I'll commit that.

#64 @youknowriad
3 months ago

In 57549:

Editor: Fix typo in FontUtils doc block.

Initially introduced in [57539]

Props kebbet.
See #59166.

@youknowriad commented on PR #6056:


3 months ago
#66

Looks like this is failing the e2e tests, it seems that the Gutenberg plugin need to "unregister" the font before registering it. We'd have to do a patch release on Gutenberg before shipping this commit to Core.

#67 @youknowriad
3 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 57558:

Editor: Register the Google Font collection.

By default, users will see a tab in the editor indicating the possibility
to active Google Fonts and install Fonts from there.

Props youknowriad, get_dave, mcsf.
Fixes #59166.

#69 @ironprogrammer
3 months ago

@youknowriad, PR 5190 appears to have been missed during merge. Should this ticket be re-opened for that to be applied as well, or added to a new ticket?

#70 @swissspidy
3 months ago

Gitignore (and svn ignore) can be hsndled in #60337. no need for reopening

Note: See TracTickets for help on using tickets.