Add more than one custom font to the narrative theme

Solved
NaomiRD
New Member
11 0 0

Hi

I would like to add 2 custom fonts to the narrative theme. One to use for headings/sub headings and the other as body text. I have already added one custom font but would like this font to be used for headings only.

If anyone has any instructions on how to do this that would be great.

Thanks

Naomi

Accepted Solution (1)

Accepted Solutions
LitExtension
Shopify Partner
2000 332 408

This is an accepted solution.

Hi @NaomiRD ,

If it helped you solve your issue, please mark it as a solution. 

If you have any difficulty, you can contact me Happy to help you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!

View solution in original post

Replies 19 (19)
LitExtension
Shopify Partner
2000 332 408

Hi @NaomiRD ,

Does that font belong to google fonts? If belong to google font, can you send me 2 font names, I will guide you in detail.

If not in google fonts, you just need to upload 2 fonts in assets. https://i.imgur.com/AZnLv4t.png 

Then you go to the file assets/theme.scss.liquid , find 'settings.type_header_font' and add code here: https://i.imgur.com/hfI3tsJ.png

Code:

@font-face {
	font-family: 'fontname_1';
	src:  url('{{ 'fontname_1.eot' | asset_url }}') format('embedded-opentype'),
        url('{{ 'fontname_1.ttf' | asset_url }}') format('truetype'),
        url('{{ 'fontname_1.woff' | asset_url }}') format('woff'),
        url('{{ 'fontname_1.svg' | asset_url }}') format('svg');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'fontname_2';
	src:  url('{{ 'fontname_2.eot' | asset_url }}') format('embedded-opentype'),
        url('{{ 'fontname_2.ttf' | asset_url }}') format('truetype'),
        url('{{ 'fontname_2.woff' | asset_url }}') format('woff'),
        url('{{ 'fontname_2.svg' | asset_url }}') format('svg');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

With fontname_1, fontname_2 is the name of the 2 fonts you upload.
And if the font you upload doesn't have formats like eot, ttf,... you can delete the corresponding code.
Ex: doesn't have formats like eot:

@font-face {
	font-family: 'fontname_1';
	src:  url('{{ 'fontname_1.ttf' | asset_url }}') format('truetype'),
        url('{{ 'fontname_1.woff' | asset_url }}') format('woff'),
        url('{{ 'fontname_1.svg' | asset_url }}') format('svg');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
NaomiRD
New Member
11 0 0
Hi @LitExtension

Thank you for helping with this. Could I just clarify a few things.

Neither of my fonts are google fonts. One I’ve paid for and the other I’ve downloaded.

Do I need to delete the additional file types and just use the ones the fonts came in? For example, Think-Pink-Regular comes in woff, otf and ttf and Renown-Monoline-Sans just come in otf.

If I’ve already added the custom-font code, should I remove this before adding this code?

Many thanks

Naomi
NaomiRD
New Member
11 0 0

Hi @LitExtension 

This is what I've now added above the settings.type_header_font.

@font-face {
font-family: 'Think-Pink-Regular_1';
src: url('{{ 'Think-Pink-Regular_1.otf' | asset_url }}') format('embedded-opentype'),
url('{{ 'Think-Pink-Regular_1.ttf' | asset_url }}') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Renown-Monoline-Sans_2';
src: url('{{ 'Renown-Monoline-Sans_2.otf' | asset_url }}') format('embedded-opentype');
font-weight: normal;
font-style: normal;
font-display: swap;
}

 

Firstly, is this correct? I've got two file types for the first font, so have included both.

Secondly - Should I now be able to choose this font from the typography section in theme settings or will it appear automatically?

 

Many thanks for all your help so far.

 

Naomi

LitExtension
Shopify Partner
2000 332 408

Hi @NaomiRD ,

I checked and it works properly. Now, you just need to name those 2 fonts( Think-Pink-Regular_1, Renown-Monoline-Sans_2 ) in the CSS file.

Ex: 

h2.feature-row__heading {
    font-family: 'Think-Pink-Regular_1';
}

Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
NaomiRD
New Member
11 0 0

HI @LitExtension 

 

Thank you so much for your help so far. That makes sense but could you tell me which css file I need to add it to? Sorry if that's straight forward. I'm still learning.

 

Naomi

LitExtension
Shopify Partner
2000 332 408

Hi @NaomiRD ,

Go to  assets/theme.scss.liquid file. You can add the CSS code here, everything will work fine.

Do you want it to replace Headings font and Body text font? https://i.imgur.com/466jODr.png 

If you want, you go to assets/theme.scss.liquid file, find 'header_font.family' and replace 'Think-Pink-Regular_1'.

Refer: https://i.imgur.com/ZBcEuLP.png => https://i.imgur.com/yJifap1.png

You can also reverse it if you need the Headings font to be 'Renown-Monoline-Sans_2'.

Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
NaomiRD
New Member
11 0 0

@LitExtension 

 

Ive add this to the bottom of theme.scss.liquid

h2.feature-row__heading {
font-family: 'Think-Pink-Regular_1';
}
h2.feature-row__heading {
font-family: 'Renown-Monoline-Sans_2';
}

Is that the correct place? 

Ive followed your instructions on adding the heading and body font which looks like this but it hasn't come up as an option in theme settings/typography. Am I missing a step?

 

$settings-font-stack-header: 'Think-Pink-Regular_1', {{ header_font.fallback_families }};
$settings-font-style-header: {{ header_font.style }};

$settings-font-stack-body: 'Renown-Monoline-Sans_2', {{ base_font.fallback_families }};

 

Thanks again. You are being so helpful.

Naomi

LitExtension
Shopify Partner
2000 332 408

Hi @NaomiRD ,

It just helps you to import the font and call it directly in the CSS file. It is not added directly in the settings of Customize.

Hope it clear to you.

If it helped you solve your issue, please mark it as a solution. Thank you and good luck.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
NaomiRD
New Member
11 0 0

Hi @LitExtension 

Im not entirely sure what you mean. How do I bring up the font on my page once I’ve added the script above? Or have I added this incorrectly?

Many thanks

Naomi