How to Add Custom Fonts to Your Shopify Theme

How to Add Custom Fonts to Your Shopify Theme

Custom fonts can enhance your Shopify store's branding, making it stand out from competitors and improving the overall user experience. Shopify allows you to add custom fonts to your theme, giving you complete control over typography. In this guide, we will cover different methods to add custom fonts to your Shopify store.

Why Use Custom Fonts in Shopify?

Using custom fonts in your Shopify store can:

  • Improve brand consistency
  • Enhance readability and user experience
  • Make your store visually appealing and unique
  • Match your website's aesthetics with your brand identity

Method 1: Using Shopify's Built-in Fonts

Shopify provides a variety of fonts through its built-in settings:

  1. Navigate to Online Store > Themes.
  2. Click Customize on your current theme.
  3. Go to Theme Settings > Typography.
  4. Select from Shopify's available fonts.
  5. Save changes and preview your store.

If Shopify's default fonts don’t match your brand, you can upload and apply custom fonts manually.

Method 2: Adding Custom Fonts Manually

Step 1: Choose and Upload Your Font

  1. Obtain a Web Font Format - Shopify supports web fonts such as .woff and .woff2. If your font is in .ttf or .otf format, convert it using an online tool like CloudConvert.
  2. Upload the Font to Shopify:
    • Go to Online Store > Themes.
    • Click Actions > Edit Code.
    • Open the Assets folder.
    • Click Add a new asset and upload your font files.

Step 2: Define the Font in CSS

  1. Open the theme.css or base.css file in the Assets folder.
  2. Add the following CSS code at the bottom:
@font-face {
    font-family: 'CustomFont';
    src: url('{{ 'your-font-file.woff2' | asset_url }}') format('woff2'),
         url('{{ 'your-font-file.woff' | asset_url }}') format('woff');
    font-weight: normal;
    font-style: normal;
}

Replace 'CustomFont' with your font's name and update 'your-font-file.woff2' with the actual file name.

Step 3: Apply the Font to Your Theme

To apply your custom font to specific elements, modify your CSS:

body {
    font-family: 'CustomFont', sans-serif;
}

You can replace body with .header, .product-title, or any other class you want to style.

Step 4: Save and Preview

Save your changes and preview your store to ensure the font is applied correctly.

Method 3: Using Google Fonts

If your desired font is available on Google Fonts, you can easily integrate it:

  1. Copy the <link> tag from Google Fonts.
  2. Open the theme.liquid file in the Layout folder.
  3. Paste the link inside the <head> section:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=CustomFont:wght@400;700&display=swap">
  1. Define the font in your CSS:
body {
    font-family: 'CustomFont', sans-serif;
}

Conclusion

Adding custom fonts to your Shopify store can greatly enhance its visual appeal and brand identity. Whether you use Shopify's built-in fonts, manually upload custom fonts, or integrate Google Fonts, following these steps will ensure a professional look for your store. If you need more customization, consider hiring a Shopify expert for further assistance.

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.