Re: Adding A Custom Font From woff File

Solved

How do I add a custom font to the Dawn theme from a woff file?

drocklin
Visitor
3 0 0

Hello community!

 

I am attempting to add a custom font to the Dawn theme.

 

  • I've uploaded a file "MERINGUE.woff2" to the assets folder. 
  • I've added the following under the {% style %} syntax in the header of the theme.liquid file:

 

 

@font-face {
      font-family: "MERINGUE";
      src: url({{"MERINGUE.woff2" | asset_url }}) format("woff2");
}

 

 

  • I've added the following to the base.css file:

 

 

h1, h2, h3, h4 {
    font-family: "MERINGUE" !important;
  }​

 

 

Preview of the store here: https://3e72b9-5.myshopify.com/?_ab=0&_fd=0&_sc=1

 

Thank you. Any help would be much appreciated!

Accepted Solution (1)
g33kgirl
Shopify Partner
390 109 143

This is an accepted solution.

Upload it to the Files section of your store. Content -> Files

 

Screenshot 2023-12-14 at 3.35.51 pm.png

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.

View solution in original post

Replies 4 (4)

g33kgirl
Shopify Partner
390 109 143

Hi @drocklin 

 

Upload the font file in the Files section and paste the complete url in src. That should work.

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.
drocklin
Visitor
3 0 0

Hi!

 

I've already uploaded the file to the assets folder, and don't see a way to grab the resulting URL.

 

g33kgirl
Shopify Partner
390 109 143

This is an accepted solution.

Upload it to the Files section of your store. Content -> Files

 

Screenshot 2023-12-14 at 3.35.51 pm.png

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.
drocklin
Visitor
3 0 0

Thank you!