You are on the right track for getting the font loaded but not in how you apply it to content. I have created a TinyMCE Fiddle that shows how to use this:
https://fiddle.tiny.cloud/C3haab/1
Your code tries to set the body font to a "light" variation of Oswald via this:
body {
font-family: Oswald-ExtraLight;
}
...but that is not the name of any font you have imported. You imported something named Oswald. In the Fiddle you will see that if you change the font-family
to Oswald that will at least get you using the font you imported:
body {
font-family: Oswald;
}
The second question then is how to you use the various weights of the font. That is handled via using CSS via font-weight
. In the Fiddle you will see I used style_formats
to provide a few different classes you can use to apply font-weights to content in TinyMCE (the classes are defined in the content_style
):
style_formats: [
{title: 'Extra Light Text (class)', inline: 'span', classes: 'extralight'},
{title: 'Light Text (class)', inline: 'span', classes: 'light'},
{title: 'Medium Text (class)', inline: 'span', classes: 'medium'},
],
The Fiddle shows this running with some pre-added text that shows some of the various weights of the font in action.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…