cancel
Showing results for 
Search instead for 
Did you mean: 

install google font local

install google font local

Hi!

I want to install google font local.

I have tried to change in the settings the theme settings at font the Basic Font Family to: Select Custom Fonts and choose the Font Family - Custom Fonts: Open Sans.

But I use still google fonts on my website agoshop.at

 

Hope someone can help me there.

kindly regards

8 REPLIES 8

Re: install google font local

Hi @haiflosse117fc ,

 

Please refer https://meetanshi.com/blog/add-and-use-google-fonts-in-magento-2/

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani

Re: install google font local

Hello @haiflosse117fc 

 

Put the following code at Vendor\Extension\View\frontend\layout\default_head_blocks.xml file or Vendor\Your_Theme\Magento_Theme\layout\default_head_blocks.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <link rel="stylesheet" type="text/css" src="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;0,800;1,300;1,400;1,600;1,700;1,800" src_type="url" />
    </head>
</page>

Take reference of above code. It may help you!

Problem solved? Click Accept as Solution!

Re: install google font local

Hi @haiflosse117fc 

Please read the following article https://simplify-everything.com/en/blog/2019/05/30/how-to-host-google-fonts-local-through-css/ it has detailed explanation about hosting the Google fonts locally.

In the article there is a service link using which you can download the font and configure the CSS as given in the article.

Give it a try and see if it works for you.

 

Thanks

 

---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: install google font local

Thanks for your answer.

It seems that is an instruction for wordpress.

In which folder or subfolder can I upload the fonts?

In which stylesheet file or where can I find my stylesheet file can I insert the ccs code?

 

kindly regards again

Re: install google font local

Hi @haiflosse117fc ,

 

Please check this one https://developer.adobe.com/commerce/frontend-core/guide/css/fonts/

 

Problem Solved? Accept as Solution!

 

Hope it helps!

Thanks

Ankit Jasani

Re: install google font local

Hey @haiflosse117fc 

 

You must add the following line to the head> section of your HTML page to include the Montserrat font on your website in its regular, regular italic, bold, and bold italic variations:

 

<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">

Then, you may include the following CSS rule in any CSS file selector:

 

div {
    font-family: 'Montserrat', sans-serif;
}

You can see all fonts by entering the URL in a browser. Also, you can customize the font family as you want.

Re: install google font local

Hey there! I've tinkered with fonts, too. To install Google fonts locally, you might need to download the font files and then upload them to your website. Once they're on your server, you can reference them in your CSS. Make sure you've cleared your browser cache, too. It can sometimes hang on to old font references. Or, you could use this gstatic guide to manage your site's fonts. I hope this helps!