I’m working on a Shopify development store and having trouble loading custom fonts. I’ve checked multiple forums but can’t seem to fix this issue.
I’m trying to implement a custom font using @font-face in my main.css.liquid file:
@font-face {
font-family: 'proxima-regular';
src: url(' {{ 'proxima-regular-webfont.eot' | asset_url }} ');
src: url(' {{ 'proxima-regular-webfont.eot?#iefix' | asset_url }} ') format('embedded-opentype'),
url(' {{ 'proxima-regular-webfont.woff2' | asset_url }} ') format('woff2'),
url(' {{ 'proxima-regular-webfont.woff' | asset_url }} ') format('woff'),
url(' {{ 'proxima-regular-webfont.ttf' | asset_url }} ') format('truetype'),
url(' {{ 'proxima-regular-webfont.svg#proximaregular' | asset_url }} ') format('svg');
font-weight: normal;
font-style: normal;
}
All font files are properly placed in the assets directory with matching names. I’m applying the font like this:
.header-text {
font-family: 'proxima-regular', Georgia, serif;
}
However, Chrome developer tools shows 404 errors when trying to fetch the fonts:
GET http://cdn.shopify.com/s/files/1/0924/9286/t/3/assets/proxima-regular-webfont.woff?13846384044068149085 404 (Not Found)
The fonts work perfectly on my local environment. The asset_url syntax appears correct and files are in the right location. What could be causing Shopify to not find these font files?