-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font Library: Frontend [Stage 1] #53884
Conversation
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/experimental/fonts/font-library/font-library.php ❔ lib/load.php ❔ phpunit/multisite.xml |
Size Change: +89.8 kB (+6%) 🔍 Total Size: 1.62 MB
ℹ️ View Unchanged
|
Flaky tests detected in 8736452. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6175605049
|
Test ReportSteps to Test(Mostly following @ironprogrammer 's handy testing guide with different browser. Note: I did not make it through his entire testing suite.)
Environment
Actual results1-2. Fonts List and Management Dialog
3-5. Upload
This was as far as I got in testing before being pulled away. Overall, there is some great stuff here. 👍 |
Thanks for the review @colorful-tones !
This is a known issue and it's being worked here: #54320 (comment). It will be fixed soon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving based on the amount of testing and reviews this PR has received. Though I have not done a thorough JS code review, this PR should be good for merging. It's time to ship it and get more feedback.
Update: I see there is #53653 now. Hi @matiasbenedetto 👋 I have some questions about the organization of the code added by this PR:
I encountered this code when running |
Hi @jsnajdr, the 3 files are coming from |
I am following @colorful-tones notes above in a similar environment with both Firefox and Chrome browsers, and the Gutenberg nightly active plugin. I ran the test using Playground as well. But I failed to upload fonts. What am I doing wrong? |
Update. Because there was no instructions, I was trying to upload the entire downloaded zip folder. But when I uploaded individual TFF file, the file uploads successfully. Thank you. |
@tinjure20 good to know. Thanks for the update! It could be a common mistake, so maybe we should add some kind of visual hint about the need to install font assets and not other types of files. |
IMHO, many users would benefit from a short warning note below the drag-and-drop area. |
Good callout, how many is too many? If you have a great suggestion for phrasing, we can run with it! On the technical side, this issue should ideally mostly disappear in the future, as the Fonts API matures to a point where only the fonts that are actually in use on a particular page of the site, are loaded. I don't believe that is the case yet, but it should be tracked for a future improvement. I'll defer to @matiasbenedetto on details here. So for the time being, it would be good to update the copy. Here's a quick attempt:
I don't actually like the specific size call-out here, to me it puts it way into developer territory, but if we can think of it as temporary until the Fonts API smartly handles it, it might be acceptable? As noted, feel free to suggest an edit! |
Hi 👋 This PR was already merged. Please, If the wording needs to be updated, open a new issue with the details of the change. |
What?
Implementation of the frontend for Font Library
Stage 1: Font management and local font uploads.
Why?
The Font Library consists of a font manager for WordPress. The Font Library is available globally, independently of the theme activated, similar to the Media Library. This 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.
Testing Instructions
Font Library is enabled by default in this PR.
To disable Font Library, add this line
define( 'FONT_LIBRARY_DISABLE', true );
to yourwp-config.php
.To make the fonts library backend work you need to add this line in your wp-config.php file:
define( 'FONT_LIBRARY_ENABLE', true );
🧪 Test in WordPress Playground:
You can try this PR on WordPress Playground following this link
Disclaimer
We are relying on the
lib-font
package to read the local font assets metadata. Currently, this PR bundles the source code of that library on the source code. We may find a better alternative for that: #53653This PR depends on:
Follow up tasks:
More info:
Tracking issue: #52698