Can we add otf fonts to the Code Editor?

Hi team, I added a client’s otf fonts following this module and was able to successfully add them as font files and declare them in the fonts.scss, but when I view them in the live preview they look like they haven’t updated and are still using the fallback Roboto.

When I inspect the page it says the correct font but I’m pretty certain it hasn’t updated when looking at what the font face should look like:

Let me know if there’s something I missed here, thank you!

Hi Hannah,

Since this is an .otf font file, there is a small difference in how you add the font-face declarations to the fonts.scss file. Unlike .woff font files where the format is “woff”, the .otf file format needs to be “opentype”. Here is an example of what that would look like:

@font-face
{
  font-family: "D-DIN";
  src: url('../assets/fonts/D-DIN-Bold.otf') format("opentype");
  font-weight: $font-weight-bold;
  font-style: normal;
}
1 Like

Thanks so much @Micaela_Luders !