Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: Shopify CLI is not working as expected

Why isn't my CLI pulling theme fonts correctly?

Bulxar
Shopify Partner
82 2 22

Theme fonts are not pulling when using Shopify CLI.

 

Expected behavior

Theme font's need to be downloaded.

Actual behavior

┃ ERROR get assets/Arial-Bold.eot: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial-Bold.ttf: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial-Bold.woff2: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial-Bold.woff: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial.eot: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial.ttf: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial.woff2: wrong number of arguments (given 4, expected 2..3)
┃ ERROR get assets/Arial.woff: wrong number of arguments (given 4, expected 2..3)

 

 

Steps to reproduce the problem

  1. Add custom font's in assets folder and push theme
  2. Pull curently pushed theme and the error will trigger
Replies 3 (3)

josialoos
Shopify Partner
5 0 1

hey, did you find a solution for this?

Bulxar
Shopify Partner
82 2 22

No, this is broken and no one is answering here, even in Github

josialoos
Shopify Partner
5 0 1

Ok I found a workaround at least:

It is not possible to pull fonts from shopify to local. I think that is by purpose, because they dont want you to upload fonts other then those they provide. They want you to use a CDN.

So either you are using Adobe Typekit, Font Awesome oder Google Fonts or some other font library which has its own CDN you can use. If so you can get your link there, for example I want to use the Google Font "Alata" which is not provided in Shopify. So I went to Google Fonts, got me the link to Google CDN and inserted this at the top of my custom CSS file. Works!

Screenshot 2021-08-05 at 16.18.55.png

Or if you have a font that is not available on a CDN already you can host it somewhere else yourself or use a CDN service (maybe cloudflare?) to do so. I haven't tried to do that but I'm sure its possible and there are tutorials for that over the internet.

If you're running a international website I would recommend not to host fonts on your own server, but on a CDN, as it will likely slow down your page.

If somebody figures this out it would be nice to share a little how-to here ... 

Hope this helps