Why isn't my custom font working on my website?

Hi!! I have uploaded DOZENS of fonts but am super stuck on this one. I can’t tell if it’s MY error or if it’s an error in the font file — I’ve redownloaded the font file from different sites, re-converted to woff/woff2, etc. But nothing is working! Any suggestions? Below is the code I’ve popped into my CSS (as usual) and along with this, I’ve added the font files under “Assets” on the theme.

@font-face {
font-family: ‘CatchyMager’;
src: url({{’ CatchyMager-Normal.woff2’ | asset_url }}) format(‘woff2’),
url({{‘CatchyMagg.woff’ | asset_url }}) format(‘woff’);
font-weight: normal;
font-style: normal;
font-display: swap;
}

h1, .h1-style, h2, h3, h4, h5, h6, .heading-font {
font-family:“CatchyMager”;
font-weight: normal;
font-style:sans-serif;
}

1 Like

Hi @sbar

It’s hard to know what is the issue without looking into your store. :frowning:

But please try to edit your css code, add ‘!important’ after font name

h1, .h1-style, h2, h3, h4, h5, h6, .heading-font {
font-family:"CatchyMager"!important;
font-weight: normal;
font-style:sans-serif;
}

Hi @sbar ,

You can also try to upload your font this way instead of doing it from the asset folder in your theme.

  1. In your Admin store, click Settings on your left hand bottom corner

  2. Go to Files, then upload your font.

  3. Copy the link when done uploading, and paste it in the font-face. See code below for reference

@font-face {
font-family: 'CatchyMager';
src: url(https://samplelink) format('woff2'),
url(https://samplelink) format('woff');
font-weight: normal;
font-style: normal;
font-display: swap;
}