Fonts uploaded to assets folder not showing.

Fonts uploaded to assets folder not showing.

AlfieHayward1
Excursionist
16 2 1

I am uploading a custom font for my store, when I add the font files to the Shopify files and grab the link and paste it into the code below it works. However I want to upload these fonts to the assets folder instead, so I upload them with no error message, title them "custom-font.xxx" and I use the following code:

 

  @font-face {
  font-family: 'custom-font';
  src: url("{{ 'custom-font.eot' | asset_url }}") format("embedded-opentype"),
       url("{{ 'custom-font.woff' | asset_url }}") format("woff"),
       url("{{ 'custom-font.woff2' | asset_url }}") format("woff2"),
       url("{{ 'custom-font.svg' | asset_url }}") format("svg"),
       url("{{ 'custom-font.ttf' | asset_url }}") format("truetype");
   }

This doesn't work and displays the preloaded font. The code works above when I paste a link in the url, however when uploading from the assets folder it doesn't work. Does anyone know if I've added the asset url wrong, or what the trouble could be?  Thanks.

Replies 0 (0)