@sg23838586 No worries! If you add the contents of the code block below to the theme.json file in your child theme, you should be good to go:
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"settings": {
"typography": {
"fontFamilies": [
{
"fontFace": [
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "200",
"src": [
"file:./assets/fonts/SourceSerifPro-ExtraLight.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "200",
"src": [
"file:./assets/fonts/SourceSerifPro-ExtraLightItalic.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "300",
"src": [
"file:./assets/fonts/SourceSerifPro-Light.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "300",
"src": [
"file:./assets/fonts/SourceSerifPro-LightItalic.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "400",
"src": [
"file:./assets/fonts/SourceSerifPro-Regular.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "400",
"src": [
"file:./assets/fonts/SourceSerifPro-Italic.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "600",
"src": [
"file:./assets/fonts/SourceSerifPro-SemiBold.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "600",
"src": [
"file:./assets/fonts/SourceSerifPro-SemiBoldItalic.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "700",
"src": [
"file:./assets/fonts/SourceSerifPro-Bold.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "700",
"src": [
"file:./assets/fonts/SourceSerifPro-BoldItalic.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "normal",
"fontWeight": "900",
"src": [
"file:./assets/fonts/SourceSerifPro-Black.ttf"
]
},
{
"fontFamily": "Source Serif Pro",
"fontStretch": "normal",
"fontStyle": "italic",
"fontWeight": "900",
"src": [
"file:./assets/fonts/SourceSerifPro-BlackItalic.ttf"
]
}
],
"fontFamily": "\"Source Serif Pro\", ui-serif, serif",
"name": "Source Serif Pro",
"slug": "child-font"
}
]
}
},
"version": 2
}
Note that this code replaces all of the font families included in Beaumont itself, so the theme will look a bit busted at first. When you’ve added the code and activated the theme:
- Go to Appearance → Editor
- Click the Global Styles icon in the top right
- Click Typography → Text in the panel, and
- Change the “Font” setting from “Default” to “Source Serif Pro”.
Let me know how it goes!
I did write pretty much all of the the theme.json file myself, but when you’ve released themes with 4000+ lines of CSS, 700+ lines of JSON doesn’t seem so bad 😃