Upload Custom Fonts
Generate your font and style files
Upload your custom font files to Font Squirrel with this tool. TTF file types have the best success. Then click the Download your kit button to get a zip file with the required files.
Add the font files to your theme
The first thing that we have to do is to add the fonts to the Shopify store. From there, we can reference it via code and use it in our theme.

Setting the Font
From your Shopify admin, navigate to Settings > Files > Upload file.
Under snippets, click on “Add a new snippet” and create a snippet named: custom-fonts
This is the code we will use:
<style>
@font-face {
font-family: "fontname";
src: url('fonturl-eot') format("embedded-opentype"),
url('fonturl-woff') format("woff"),
url('fonturl-woff2') format("woff2"),
url('fonturl-ttf') format("truetype"),
url('fonturl-svg') format("svg");
}
</style>
In our case, it would look like this:
<style>
@font-face {
font-family: "Poppins";
src: url('https://cdn.shopify.com/s/files/1/0439/1577/2000/files/Poppins.ttf?v=1618926445') format("truetype");
}
</style>
4. Finally, in the custom-fonts snippet that we created, add the following code before the </style> line. Don’t forget to also rename “Poppins” to whichever font name you’re using:
<style>
@font-face {
font-family: "Poppins";
src: url('https://cdn.shopify.com/s/files/1/0439/1577/2000/files/Poppins.ttf?v=1618926445') format("truetype");
}
h1,h2,h3,h4,h5,h6,html,body,*,[id] *{
font-family: "Poppins" !important;
}
</style>
Loading the custom font
Look for an open theme.liquid inside your snippets folder. Find the: </body> tag, and add the following code:
{% include 'custom-fonts' %}

Last updated