problems when adding sans serif font
-
I’m running Create Block Theme 1.8.1 on WordPress 6.2
Adding a local font works fine for me, as long as the font is a serif font.
Sans serif fonts have their source files copied in correctly, and added to theme.json, but they don’t render. Instead you see the Default font.
Apparently the generated CSS needs to be told that these are sans serif fonts. I fixed this problem by manually editing my theme.json file, for example after adding the local font, change the fontFamily line from
"fontFamily": "Advocate OT 14 Cond Reg",
to
"fontFamily": "\"Advocate OT 14 Cond Reg\", sans-serif", "name": "Advocate OT 14 Cond Reg",
and now your website renders this font correctly!
However note that when you open Appearance > Manage Theme Fonts, the Preview of your sans serif font will be wrong. You will see the Default font instead.
- The topic ‘problems when adding sans serif font’ is closed to new replies.