Jump to content

Custom Font Not Rendering Properly

Go to solution Solved by tuanphan,

Recommended Posts

Site URL: https://authenticaudience.co/high-converting-design-masterclass

Hey hey

I'm looking to slightly adjust my font styles on one page in particular and am running into an issue. When I'm in edit mode it looks totally fine, but on other browsers it's just rendering as a random serif font. Here's the code I'm using:

 

@font-face {
    font-family: 'awesome';
    src: url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bdb9470fd4651d24b3e71/1700518804623/Awesome+Serif+VAR-VF.ttf') format('truetype'),
           url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bdc0656079d5a8617a954/1700518918904/awesome_serif_var-vf-webfont.woff2') format('woff2'),
         url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bdc0148a6cd39a3a6dc15/1700518913415/awesome_serif_var-vf-webfont.woff') format('woff');
    font-style: normal;
      font-display: swap;
}

@font-face {
  font-family: 'HKGrotesk-Black';
  src:
    url ('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/66e83043479f33444f2cb5a7/1726492739277/HKGrotesk-Black.woff2') format('woff2');
  font-style: normal;

@font-face {
    font-family: 'hk-grotesk';
    src: url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bdd8ab47bc964bc36e11b/1700519306410/HKGrotesk-Regular.otf') format('opentype'),
           url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bdddd70fd4651d24bd81e/1700519389950/hkgrotesk-regular-webfont.woff2') format('woff2'),
         url('https://static1.squarespace.com/static/64e500fe327f3f43b04794a9/t/655bddd757c5916bc6a72fc4/1700519383413/hkgrotesk-regular-webfont.woff') format('woff');
    font-style: normal;
      font-display: swap;
}

h1, h2, h3 {
    font-family: 'awesomeserif-tall'!important;
    p {
      font-family: 'hk-grotesk-regular'!important;
      letter-spacing: '-1px';
      font-weight: 400;
    }
  }
 h4, .sqsrte-large, {
    font-family: 'HKGrotesk-Black'!important;
  }
}

ScreenShot2024-09-26at2_44_55PM.thumb.png.851019017acc51c9bdda59d12b5300b8.pngScreenShot2024-09-26at2_45_09PM.thumb.png.c2e225f39ed15a9549111e3745314c8f.png

Link to comment
  • Replies 2
  • Views 383
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution

To use awesomeserif-tall  and hk-grotest-regular you need to declare @font-face for them

and make sure font-family here same as font-family in @font-face code

If both font families are different, the browser will not recognize which element's font-face belongs to.

image.png.2ef2f83ba74441f7001173921f8a7e88.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.