Shopify custom font OTS parsing error Size of decompressed WOFF 2.0 is less than compressed size

Issue warning details

Reason

Currently, I am not aware of the underlying cause; I merely know that this predicament emerged subsequent to the update of the Shopify online editor.

How to solve

Kindly log in to your Shopify backend, and subsequently enter the term “file” within the search field.

Proceed with the upload of the custom font file that you intend to utilize.

Upon successful completion of the upload, click on the option to copy the file link.

To finalize the process, incorporate the custom font CSS code into your theme.

1
2
3
4
@font-face {
font-family: "ConthraxSb";
src: url("https://cdn.shopify.com/s/files/1/0383/1608/1284/files/ConthraxSb-Regular.woff?v=1686799251") format("woff");
}

PS:While Shopify recommends using ‘file_url’ as the preferred method, at the time of my writing, ‘file_url’ still exhibits the same issue as ‘asset_url’. Therefore, in this instance, I directly copied the file link for reference.

1
2
3
4
@font-face {
font-family: "Font name";
src: url("{{ '[font-file-name]' | file_url }}") format("[font-format]");
}