Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 23h 20m 54s
Claim 50% off
Solved Templates

Embed google fonts localy to a Joomla 4 Template

Asked by Stefan Hirschmann 5 years ago Last activity 3 years ago

Hi there,
how can google fonts be embended locally in Joomla 4? I use the PITCH template?
thank you for your help

PS: the way like in Joomla 3 to copy the fonts in the folder .../template/fonts and add the css-code in custom.css does not work!

Accepted answer

Marked as the solution
Ofi Khan Staff

Hello Stefan Hirschmann

Please follow this documentation to host google fonts locally. Yes, custom CSS file path is the same as before (css/custom.css). Please follow this documentation.

Best regards

15 more replies

Pavel

Hi. You are wrong. This works exactly the same as in J3. This is a very simple procedure and no one would reinvent the wheel to do this job any other way. Most likely you are just doing something wrong. For example, the css file name is not correct or the path to the font files in your code is not correct.

Martin Seidl

Hi Pavel,
I just can say I copied the google font ttf and woff file into the fonts folder and created a custom.css and embedded
/ amatic-sc-regular - latin /
@font-face {
font-family: 'Amatic SC';
font-style: normal;
font-weight: 400;
src: url('../fonts/amatic-sc-v24-latin-regular.eot'); / IE9 Compat Modes /
src: local(''),
url('../fonts/amatic-sc-v24-latin-regular.eot?#iefix') format('embedded-opentype'), / IE6-IE8 /
url('../fonts/amatic-sc-v24-latin-regular.woff2') format('woff2'), / Super Modern Browsers /
url('../fonts/amatic-sc-v24-latin-regular.woff') format('woff'), / Modern Browsers /
url('../fonts/amatic-sc-v24-latin-regular.ttf') format('truetype'), / Safari, Android, iOS /
url('../fonts/amatic-sc-v24-latin-regular.svg#AmaticSC') format('svg'); / Legacy iOS /
}
body,p,h1,h2,h3,h4,h5,h6 {font-family: 'Amatic SC', Verdana;}

inside, I also deactived in the template options all typographics

but the google font is not displayed

I also went to pages > options and there I also disabled the google fonts...

still no google font loaded.... :-(

see also https://www.sevika.de/

Pavel

Hi. In the code of your site there are no google fonts. You can check this by opening the source page's code in the browser.

If you mean Roboto and others, it is from youtube player

Pavel
3 years ago · edited

I meant that there is no font connection through URL like //fonts.googleapis.com/. So you have selfhosted font which you downloaded from Google Fonts site.

For clarity. Under the term "Google font" on the site, usually means a font connected through the URL from Google.

Pavel

Perhaps due to the inconsistency of terms, I did not understand your question correctly.
Now I assume that you make in mind that the font that you uploaded to the site does not work. Right?

If so, go to the template settings and delete wrong code from Custom CSS field

In custom.css file сorrect the path for confidence

from ../fonts/amatic----- to /templates/shaper_helixultimate/fonts/amatic-----

And this is not necessarily

body,p,h1,h2,h3,h4,h5,h6 {font-family: 'Amatic SC', Verdana;}

Enough so

body {font-family: 'Amatic SC', Verdana;}
Martin Seidl

Pavel you are great, you got the point. Because of you and Paul I stay with joomshaper!!!
The path was wrong, got it!

One more: now as I dont configure the font-sizes of the headings and menu items any more through the template options, do I have to configure them in custom.css or can I still use template options and enable typography and choose again the google font and choose correct font size?

I guess I cant because then again google fonts will be loaded from USA, right? so better use custom.css?

Pavel

I guess I cant because then again google fonts will be loaded from USA, right? so better use custom.css?

Yes, that's right

Martin Seidl

puuuh , lots of work for I need to style also responsive view for all headings :-(, thanks

Martin Seidl

sorry Pavel.
stille one google font os loaded and I cant find it anywhere:

Font - https://fonts.gstatic.com/s/roboto/v18/kfomcnqeu92fr1mu4mxk.woff2

I disabled in page builder options google fonts
I disabled font awesome in advanced template settings
but still robot is loaded from google server....

maybe it is in the youtube iframe ???

Log in to reply.