Why isn't my custom font displaying correctly on my website?

Hi,

I’m using the Out of the Sandbox theme “Flex” and have a custom font uploaded to my site. When I use dev tools to inspect the site, the correct font name is showing up but it’s not the font that I’ve added to the site.

The font that I need on my site is “Marilyn Wilde” and it’s a script font. The font displayed is a serif font. When I inspect the page using dev tools, the font is being called Marilyn Wilde but it’s not the script font.

I’ve uploaded the Marilyn Wilde font to the assets on my site and am using this code:

Site Preview

Anyone know what could be wrong? Thanks!

Hi @SamCDesigns

It’s {{ “Blacker-Sans-Pro-Book.woff2” | asset_url }}

here is the example

@font-face {
          font-family: "Blacker Sans Pro Book";
          font-display: swap;
          src: url({{ "Blacker-Sans-Pro-Book.woff2" | asset_url }}) format("woff2");
}

Hello @SamCDesigns ,

It’s GemPages support team and glad to support you today.

You could please try changing the code to

@font-face {
          font-family: "MarilynWilde-Regular";
          src: url({{ "MarilynWilde-Regular.woff" | asset_url }}) format("woff");
}

If you require any further information, feel free to contact me.

Best regards,
GemPages Support Team

Hi, I tried this and it still isn’t working. Do you have any other ideas?

@Kani Thanks for your help. I tried it and it still isn’t working. Do you have any other ideas?

@SamCDesigns

oh sorry for that issue, are you sure you have upload these all font type like TTF, OTF, WOFF, WOFF, SVG

Hi @SamCDesigns

missed {{

@font-face {
      font-family: 'MarilynWilde-Regular';
      src: url({{'MarilynWilde-Regular.woff' | asset_url }}) format ('woff');
}

Hi Kani, Thanks so much for trying to help me troubleshoot this. Here’s the
exact code I have:
@font-face {
font-family: ‘MarilynWilde-Regular’;
src: url({{‘MarilynWilde-Regular.woff’) | asset_url }}) format
(‘woff’);
}

I do have the font uploaded as woff under assets. Do I have to upload every
single file type for this to work or will just woff be okay?

Hi @SamCDesigns

I see you did it.

and yes, you can add other font file, just remember using this way to get asset url

{{'Asset Name' | asset_url }}

Oh wow. I didn’t realize I had to upload every different file type per
font.

How do I get all the different file types? Do I have to upload all of them?

Hi @SamCDesigns

You may need to ask your designer, you can check below and see if you have to add all of them

@font-face {
 font-family: 'myFirstFont';
 src: url('YourWebFontName.eot'); /* IE9 Compat Modes */
 src: url('YourWebFontName.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
         url('YourWebFontName.woff') format('woff'), /* Modern Browsers */
         url('YourWebFontName.ttf')  format('truetype'), /* Safari, Android, iOS */
         url('YourWebFontName.svg#YourWebFontName') format('svg'); /* Legacy iOS */
}