Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
So, we have a woff custom font file. And it works fine on my local. But when I load it to Assets folder and embed it using font-face, the font can't be decoded, I'm getting the error: "OTS parsing error: incorrect file size in WOFF header" (woff2 font has the same problem).
I'm following the link to the font given by asset_url filter, downloading the font file from there, and trying to use it on my local. And - it shows me the same error! More than that - the file from Shopify is 42kb, while the original file is 23kb!
So the question is - does Shopify corrupt fonts? And how to fix this?
Hi @dmogil,
Try the instructions below but if this does not work, you can try the other solution I included in my website
Thanks, but it is not about my actual problem - font files been corrupted
I am having the same issue on my friends site. This video doesn't solve the issue. does anyone else have a solve for fixing the corrupted fonts issue?
Ran into the same Issue... seems to be a very ugly bug in shopify.
As soon as you upload webfonts in woff or woff2 (awfully no other formats like .otf is supported when uploading it into the assets folder of your theme) the file gets corrupted. We got a workaround, just upload into the files section within your shop settings, then use the file_url instead of the asset_url. This workaround worked for us.
nice, this solved my problem.
the woff2 / woff files need to file upload, then load them into theme.liquid
<link rel="preload" href="fileurl.woff2" as="font" type="font/woff2" crossorigin="anonymous">
refer from this article point no.5
https://sections.design/blogs/shopify/preloading-fonts
This worked for me as well. Thank you.
Thanks for that, uploading to Files and | file_url }} still works!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024