Solved

Importing Fonts Error

  • 31 July 2023
  • 2 replies
  • 257 views

Badge

Hi,

We are trying to import the below font  but get an error “one or more font files cannot be accessed..”

 

https://artisansofdevizes.com/static/version1689767617/frontend/WilliamsCommerce/sarsen/en_US/fonts/butler/regular/Butler.woff2

 

Our Development team have checked and say the font is is not restricted and or locked down and should be available to import.

 

I would like to sense check that there is nothing wrong with the file we are trying to import and if anyone has had the same issue and found a way around it? 

 

Many Thanks,

 

icon

Best answer by Brian Turcotte 31 July 2023, 20:20

View original

2 replies

Userlevel 7
Badge +36

Hi @SSG NB!

 

First, I would ensure that you are following the steps outlined in our Help Center article:
 

Imported fonts, sometimes called self-hosted fonts, are recommended only for senders who have access to a developer. To use an imported font, you’ll first need to host the font, either on your servers or using a font-hosting service. Make sure to enable Cross-Origin Resource Sharing (CORS) by setting the Access-Control-Allow-Origin header to *, so the font can be accessed by your recipients’ inboxes. Learn more about CORS. 

Once you’ve successfully hosted the font, click Import Font in the Add Font modal and paste your hosting URL into the Source address field. Add in your font’s name, weight, and style to the appropriate fields. 

Finally, choose a fallback font and click Add Font.

 

The step that is often forgotten is to enable CORS, as mentioned in this Community post:

 

I hope this helps, and thanks for using the Community!

 

Best,

Brian

Using a wildcard would trust all domains and this could be dangerous - can we use a source instead?

e.g. Header always set Access-Control-Allow-Origin "https://example.com”

but what would the source URL for Klaviyo be?

Reply