[wp-trac] [WordPress Trac] #63568: WP_Font_Face: Font names that contain single quotes are not wrapped in double quotes
WordPress Trac
noreply at wordpress.org
Fri Mar 20 12:25:09 UTC 2026
#63568: WP_Font_Face: Font names that contain single quotes are not wrapped in
double quotes
-------------------------------------------------+-------------------------
Reporter: wildworks | Owner: audrasjb
Type: defect (bug) | Status: accepted
Priority: normal | Milestone: Future
| Release
Component: Editor | Version: 6.4
Severity: normal | Resolution:
Keywords: has-patch has-test-info has- | Focuses: ui, css
screenshots has-unit-tests needs-testing dev- |
feedback |
-------------------------------------------------+-------------------------
Comment (by jonsurrell):
[#comment:51 There is an error in my previous comment]:
> invalid value `DM Sans` after JSON decoding
This is not accurate. `DM Sans` is valid and equivalent to `"DM Sans"`. A
font family name may be a quoted string or a sequence of one or more
identifiers, [https://drafts.csswg.org/css-fonts-4/#family-name-syntax in
which case]:
> If a sequence of identifiers is given as a `<family-name>`, the computed
value is the name converted to a string by joining all the identifiers in
the sequence by single spaces.
The spec does say:
> To avoid mistakes in escaping, it is recommended to quote font family
names that contain white space, digits, or punctuation characters other
than hyphens
I don't see any reason not to quote ''all'' family names and only leave
generics unquoted for the sake of simplicity in the font system. Custom
idents cannot start with a number, so using quotes would protect against
problems with a family name starting with a number.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63568#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list