Skip to main content
Contributor I
Jul 31, 2023 10:44 AM UTC
Solved

Importing Fonts Error

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,

 

    This topic has been closed for replies.
    Brian Turcotte
    Klaviyo Alum
    Jul 31, 2023 6:20 PM UTC

    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

    2 replies

    Brian Turcotte
    Klaviyo Alum
    Jul 31, 2023 6:20 PM UTC

    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

    Contributor I
    Feb 14, 2024 6:42 PM UTC

    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?