Skip to content

Font Library: Reduce uploaded-font-name fix to the minimal surface - #81801

Draft
sirreal wants to merge 3 commits into
trac-63568/uploaded-font-name-minimal-fixfrom
trac-63568/uploaded-font-name-minimal-v2
Draft

sirreal wants to merge 3 commits into
trac-63568/uploaded-font-name-minimal-fixfrom
trac-63568/uploaded-font-name-minimal-v2

Conversation

@sirreal

@sirreal sirreal commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Keep the essential Trac 63568 fix — escape uploaded font family names into CSS values at the client/server boundary (createCssString) and separate the display name from the CSS value — while restoring the FontFace-API-based font loading from trunk instead of rewriting it onto constructed stylesheets.

Stored escaped values are decoded back to plain family names inside formatFontFaceName, the single choke point both loadFontFaceInBrowser and unloadFontFaceInBrowser already flow through, so load and unload matching stay consistent for escaped and legacy raw values alike.

Targets #76782

Keep the essential Trac #63568 fix — escape uploaded font family names
into CSS values at the client/server boundary (createCssString) and
separate the display name from the CSS value — while restoring the
FontFace-API-based font loading from trunk instead of rewriting it onto
constructed stylesheets.

Stored escaped values are decoded back to plain family names inside
formatFontFaceName, the single choke point both loadFontFaceInBrowser
and unloadFontFaceInBrowser already flow through, so load and unload
matching stay consistent for escaped and legacy raw values alike.

createCssString escapes every character outside [A-Za-z0-9_-]/non-ASCII
with terminator-less six-digit escapes, making the value a verified
fixed point of WP_Font_Utils::sanitize_font_family() and a valid
unquoted identifier sequence (core strips the surrounding quotes when
printing @font-face rules).

Also splits the package tsconfig into build and dev projects so test
files and jest types stay out of the published build-types.
@sirreal sirreal added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Aug 19, 2026
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Edit Site /packages/edit-site labels Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Size Change: -246 B (0%)

Total Size: 7.73 MB

📦 View Changed
Filename Size Change
build/scripts/edit-site/index.min.js 335 kB -6 B (0%)
build/scripts/editor/index.min.js 532 kB -240 B (-0.05%)

compressed-size-action

@sirreal
sirreal force-pushed the trac-63568/uploaded-font-name-minimal-v2 branch from 10c92a6 to 7cd9b4b Compare August 19, 2026 03:49
@github-actions

github-actions Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sirreal <jonsurrell@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot removed [Package] Editor /packages/editor [Package] Edit Site /packages/edit-site labels Aug 19, 2026
@sirreal
sirreal force-pushed the trac-63568/uploaded-font-name-minimal-v2 branch from 7cd9b4b to 10c92a6 Compare August 19, 2026 03:57
@github-actions github-actions Bot added [Package] Editor /packages/editor [Package] Edit Site /packages/edit-site labels Aug 19, 2026
# Conflicts:
#	packages/global-styles-ui/tsconfig.json
@github-actions github-actions Bot removed [Package] Core data /packages/core-data [Package] Plugins /packages/plugins [Package] Components /packages/components [Package] Block library /packages/block-library [Package] Notices /packages/notices [Package] Block editor /packages/block-editor [Package] Preferences /packages/preferences [Package] Media Utils /packages/media-utils [Package] Commands /packages/commands [Package] Core commands /packages/core-commands [Package] DataViews /packages/dataviews [Package] Fields /packages/fields [Package] Theme /packages/theme [Package] UI /packages/ui [Package] Sync /packages/sync labels Aug 19, 2026
@sirreal
sirreal marked this pull request as draft August 19, 2026 04:18
@sirreal
sirreal changed the base branch from trac-63568/uploaded-font-name-minimal-fix to trunk August 19, 2026 04:18
@sirreal
sirreal changed the base branch from trunk to trac-63568/uploaded-font-name-minimal-fix August 19, 2026 04:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Edit Site /packages/edit-site [Package] Editor /packages/editor [Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant