-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Face: to generate and print font-face styles for theme.json fonts #51770
Merged
Commits on Jul 6, 2023
-
The Resolver handles data interaction between the theme.json and WP_Font_Face. It gets the fonts from theme.json and converts into the array structure needed for font-face processing.
Configuration menu - View commit details
-
Copy full SHA for 3ffdfa1 - Browse repository at this point
Copy the full SHA 3ffdfa1View commit details -
This new class handles validating font-face properties and generating and printing font-face styles. Only the "generate_and_print()" method is public exposed. All other functionality is hidden as interworkings. Integrates WP_Fonts_Provider_Local into the class, rather than as a separate provider class, as Font Face only supports local font files. By integrating into the WP_Font_Face, it avoids exposing provider registration and eliminates future BC concerns. If in the future support for custom providers is needed, the local provider functionality can be safely removed from WP_Font_Face without BC concerns or impacts.
Configuration menu - View commit details
-
Copy full SHA for fe8106c - Browse repository at this point
Copy the full SHA fe8106cView commit details -
This function works for both block-powered and classic sites. For block-powered sites, it gets the fonts from theme.json via the Font Face Resolver. For classic sites, themes and plugins can programmatically invoke it and pass their fonts to it. The instance of WP_Font_Face is variable cached within this global function instead of providing a separate global function. Why? The entry point to use Font Face is via wp_print_font_faces(). No other methods are public. Therefore, a global wp_font_face() function should not be needed as it would not provide benefits.
Configuration menu - View commit details
-
Copy full SHA for 017862e - Browse repository at this point
Copy the full SHA 017862eView commit details -
Relocate iframed editor assets font printing.
Removes wp_print_fonts() from _gutenberg_get_iframed_editor_assets(). Adds a filter callback to into each global functions file. This approach keeps the code centralized with its specific print function. Benefits: * Avoids switching logic in _gutenberg_get_iframed_editor_assets(). * Avoids confusion for backporting to Core.
Configuration menu - View commit details
-
Copy full SHA for f91f244 - Browse repository at this point
Copy the full SHA f91f244View commit details -
Configuration menu - View commit details
-
Copy full SHA for aaeb453 - Browse repository at this point
Copy the full SHA aaeb453View commit details -
1. The action is passing an empty string. Removed the `array` type hint. 2. Fixed the instantiation code. 🤦
Configuration menu - View commit details
-
Copy full SHA for 0cf9f63 - Browse repository at this point
Copy the full SHA 0cf9f63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5e189d4 - Browse repository at this point
Copy the full SHA 5e189d4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5aed83c - Browse repository at this point
Copy the full SHA 5aed83cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f5f107 - Browse repository at this point
Copy the full SHA 2f5f107View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab03732 - Browse repository at this point
Copy the full SHA ab03732View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9048aaf - Browse repository at this point
Copy the full SHA 9048aafView commit details -
Configuration menu - View commit details
-
Copy full SHA for 771934c - Browse repository at this point
Copy the full SHA 771934cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 458b1dd - Browse repository at this point
Copy the full SHA 458b1ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 818259d - Browse repository at this point
Copy the full SHA 818259dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f172e9 - Browse repository at this point
Copy the full SHA 5f172e9View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac45ee2 - Browse repository at this point
Copy the full SHA ac45ee2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd8b39c - Browse repository at this point
Copy the full SHA bd8b39cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 610f403 - Browse repository at this point
Copy the full SHA 610f403View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2986f7e - Browse repository at this point
Copy the full SHA 2986f7eView commit details -
Return an empty array if no fonts are defined. This method should alw…
…ays return an array
Configuration menu - View commit details
-
Copy full SHA for 3a1af83 - Browse repository at this point
Copy the full SHA 3a1af83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2fc983c - Browse repository at this point
Copy the full SHA 2fc983cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d9a4e36 - Browse repository at this point
Copy the full SHA d9a4e36View commit details -
Configuration menu - View commit details
-
Copy full SHA for 265b5e0 - Browse repository at this point
Copy the full SHA 265b5e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b2e0a09 - Browse repository at this point
Copy the full SHA b2e0a09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f90a70 - Browse repository at this point
Copy the full SHA 3f90a70View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c23eab - Browse repository at this point
Copy the full SHA 5c23eabView commit details -
Remove unused property.
Configuration menu - View commit details
-
Copy full SHA for 674187e - Browse repository at this point
Copy the full SHA 674187eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf95e34 - Browse repository at this point
Copy the full SHA cf95e34View commit details -
Configuration menu - View commit details
-
Copy full SHA for a59bb60 - Browse repository at this point
Copy the full SHA a59bb60View commit details -
Configuration menu - View commit details
-
Copy full SHA for b878840 - Browse repository at this point
Copy the full SHA b878840View commit details -
Configuration menu - View commit details
-
Copy full SHA for e392dca - Browse repository at this point
Copy the full SHA e392dcaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 41860aa - Browse repository at this point
Copy the full SHA 41860aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7fedb60 - Browse repository at this point
Copy the full SHA 7fedb60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 33f65a2 - Browse repository at this point
Copy the full SHA 33f65a2View commit details -
Revert "Quick and dirty fix for non-iframed editor. See https://wordp…
Configuration menu - View commit details
-
Copy full SHA for c6746db - Browse repository at this point
Copy the full SHA c6746dbView commit details -
1. Adds a test case to the fonts directory. 2. Adds a dataset trait for sharing datasets amongst different test classes. This change the maintance burden of redundant datasets by centralizing in a shared trait. 3.Removes the style variation tests as these are no longer relevant to the Font Face. 4. A wee bit of renaming and reformatting.
Configuration menu - View commit details
-
Copy full SHA for 8ef75f1 - Browse repository at this point
Copy the full SHA 8ef75f1View commit details -
1. Adds test for when no fonts are passed into the function, i.e. meaning it will pull from the resolver. 2. Improves resolver test to validate the full returned array structure. 3. Moves the expected fonts to the dataset trait to share it between these 2 tests. 4. A wee bit of girlscouting.
Configuration menu - View commit details
-
Copy full SHA for 6359091 - Browse repository at this point
Copy the full SHA 6359091View commit details -
Bail out if no fonts to process.
1. Adds guard clause to WP_Font_Face::generate_and_print(). 2. Adds unhappy test for it. 3. Adds similar unhappy test for wp_print_font_faces().
Configuration menu - View commit details
-
Copy full SHA for 6f8e601 - Browse repository at this point
Copy the full SHA 6f8e601View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.