Fonts: Normalize CSS font face font-family name on font upload.#11193
Fonts: Normalize CSS font face font-family name on font upload.#11193sirreal wants to merge 7 commits intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| 'context' => array( 'view', 'edit', 'embed' ), | ||
| 'properties' => array( | ||
| 'fontFamily' => array( | ||
| 'description' => __( 'CSS font-family value.' ), |
There was a problem hiding this comment.
This description is wrong, or at least is isn't what the Gutenberg client is sending.
In WordPress/gutenberg#76253 I sent over a real CSS value, and that resulted in the readable font name including CSS escapes.
Either way, it seems best to do this on the server.
The actual data that should be sent here is a plain string, not CSS. For example:
- ✅
My Font Nameis an appropriate string to send - 🚫
"My Font\20 Name"is a CSS string - do not send this!
|
Alternative to #9951 |
| @@ -344,7 +344,7 @@ public function get_item_schema() { | |||
| 'description' => __( 'CSS font-family value.' ), | |||
|
This doesn't seem to be an appropriate approach. I've tested the "install font" flow (that relies on Google Fonts) and that does send CSS strings like It does seem like:
|
I attempted to use a CSS font family on upload, but that results in broken display: WordPress/gutenberg#76253
Trac ticket: https://core.trac.wordpress.org/ticket/63568
Use of AI Tools
None.