Joart is trying to add a custom font to their Discourse theme via the assets repository but encounters issues. After sharing their code and setup, Southpaw points out a potential path discrepancy in the about.json and CSS files. awesomerobot suggests referencing the font files using asset names as variables in the CSS.
Despite trying these suggestions, Joart still faces issues. pfaffman asks for more code details and suggests sharing the theme on GitHub. Southpaw shares their own experience with adding custom fonts, noting the importance of using a reputable font converter.
Ultimately, Joart resolves the issue by using a .ttf font format instead of .woff2. The solution involves uploading the font file using the Add Upload modal and adding the necessary @font-face and body lines in the theme’s SCSS.
I’m sure I’m oversimplifying, but I notice in your about.json snippet, the path to the fonts points to an assets folder, but in your css, the path points to a fonts folder. Are you sure the css source path is correct?
I played with this a bit on a fairly new Discourse instance, and had some trouble with the first few fonts I tried. I had converted them to .woff2 using a free, online converter, and I think maybe it didn’t do a good job.
When I tried with an .otf font and again with another .woff2 font converted by a more reputable converter, I was able to add the custom font using the steps in guide @pfaffman and @awesomerobot linked.
It really only took two steps - uploading the file using the Add Upload modal, and adding just the @font-face and body lines of the example SCSS to the theme or component.
I’m sure if you can tell give us more detail and share your code and the fonts, we can help you get this figured out.