Archived topic
GoogleFonts locally
6 replies · Started by Raul on February 7, 2021
Good morning,
I downloaded Montserrat Google font and created a "font"-folder directly on my mainsite: https://www.domain.de/fonts/
I uploaded alle fonts to this directory, and used this both codes:
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Montserrat';
return $fonts;
} );
and the respective CSS from google with correct url. Than I called my site and selected as typography the new locale font. But it's not working. I start cloeaning the cache and browser cache too but no result.
Hi there,
I believe you've followed our documentation regarding this?
https://docs.generatepress.com/article/adding-local-fonts/
You may have missed this part. You'll need to add @font-face for your specific font.
https://docs.generatepress.com/article/adding-local-fonts/#using-font-face
Hi,
I wrote the font-folder "https://www.domain.de/fonts/" on the google site before I selected and copied the CSS code to my site.
I wrote the font-folder “https://www.domain.de/fonts/” on the google site before I selected and copied the CSS code to my site.
Can you link us to the site/page in question so we could check?
You can provide the site details on the private information text field. Thank you.
Sure. Font Is Montserrat
I discovered why. I had https://mysite.de in my preferences of wordpress but I write https://www.mysite/fonts in the css. So I added "www" to my preferences of wordpress.
But after I leave the customizer and call it again the Monreat from Google Fonts remotly is selected?
Hi there,
Try naming it something different like "Montserrat Local". That way it won't get confused with the Google fonts version.