[wp-trac] [WordPress Trac] #59876: Theme.json fontWeight issue with shared slug names and fontFace
WordPress Trac
noreply at wordpress.org
Thu Nov 30 22:46:04 UTC 2023
#59876: Theme.json fontWeight issue with shared slug names and fontFace
--------------------------+----------------------
Reporter: dogwonder | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Themes | Version: 6.4
Severity: minor | Resolution: invalid
Keywords: | Focuses:
--------------------------+----------------------
Changes (by ironprogrammer):
* keywords: needs-testing =>
* status: new => closed
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
Welcome to Trac, @dogwonder! Thank you for the report!
Variations within a particular font (e.g. Colfax Web) should be individual
`fontFace` arrays under a shared top-level `fontFamily`. Please refer to
the "Secondary" font in the code sample from
[https://developer.wordpress.org/themes/global-settings-and-
styles/settings/typography/#registering-web-fonts-font-faces Registering
web fonts (font faces)].
As noted in related ticket #59911, in 6.4 the rendered `@font-face` values
are determined by the first font that is found in the
`typography.fontFamilies.fontFamily` prop (see
[https://github.com/WordPress/gutenberg/pull/54615 GB PR 54615]). The font
resolver expects one top-level `fontFamily` per face, so each subsequent
re-defining of the same font overwrites the last, causing the behavior
you've noted.
I recommend checking out the [https://developer.wordpress.org/themes
/global-settings-and-styles/settings/typography/ `theme.json` docs] or
forums (https://wordpress.org/support/forums/) for additional details and
support. Please feel free to reopen this ticket if I've missed something
and adjusting the theme.json isn't working as expected.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59876#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list