I’ve done this plenty of times in the past: upload a font file to assets, link to it with @font-face in either the css file or in the theme.liquid head inside tags.
For some reason, I’m getting these warnings in the console:
Failed to decode downloaded font: {{ font url }}
and then
OTS parsing error: Failed to convert WOFF 2.0 font to SFNT
I originally thought we, bugger, font files screwed, lets get another one. So apparently we can’t upload ttf files to assets anymore? Okay, so then I went and found a random woff that I knew WAS working from assets folder, uploaded it, same warnings.
I thought this ain’t right, used the fonts an a completely external site, both work fine. Rightio. So next I tried to upload the font through Settings > files, and low and behold it works fine!
Only problem is, client had a trial site and they don’t allow woff files for trials! FFFFFFFS
Anyone know if this is a known issue, any other "workarounds I haven’t thought of?
Yes, fonts seem to get corrupted in the assets folder. Had to move them to the files upload area and access with file_url instead of asset_url to fix the problem.
Recently having issues on using custom fonts uploaded on Shopify theme assets folder. When a font is connected & used on theme from the theme asset folder via @font-face , it faces issues on loading properly, although the exact same font is being used on older uploaded themes.
Error notices on console:
“Failed to decode downloaded font: ”
“OTS parsing error: Failed to convert WOFF 2.0 font to SFNT”
“OTS parsing error: incorrect file size in WOFF header”
At first I thought the font got corrupted somehow. So repackaged the font correctly (though it wasn’t corrupted, but still tried to be safe) & then re-uploaded on the theme asset folder. But still the error persists. Also tried other possible solutions. But none works when the font is uploaded & used from theme asset folder.
If anyone is facing the same & found a workaround please, let me know. Or share your experience, so that we can understand what is happening!
How do you upload it to the site files? I’m a Shopify Newbie and within the edit code section there’s no obvious way to get to the file structure beyond the folders they’re showing you.