Archived topic
Local Font in the Backends
13 replies · Started by Francesco on January 20, 2022
Hi Guys,
many thanks for the work you're doing here.
I have a problem on this site https://www.genocideagainstroma.joro.xyz/
According to your instructions, I use the fonts locally.
There are no problems in the frontend, but unfortunately the Cairo font is not displayed in the backend.
What I'm doing wrong?
Many thanks.
Hi there,
the @font-face CSS has to be enqueued in the editor as well.
How did you add the @font-face CSS ? Was it in a Child Theme or the Customizer > Additional CSS?
Thanks for the fast reply.
I'm using a Child Theme.
I added the @font-face CSS using Customizer > Additional CSS
See this reply for the PHP Snippet you need:
https://generatepress.com/forums/topic/include-custom-font-in-editor/#post-2055409
You're my hero.
Many thanks.
Glad to be of help
Hi,excuse me for having to reopen this topic.
I have locally uploaded the font Cairo (latin, latin-ext) but on this page, the font is not displayed:
Another thing is that the font Oswald (locally uploaded too), all over the site, is still loaded as Google Font.
What I’m doing wrong?
Many thanks.
Hi there,
1. make sure you clear your browser caches - as i only see these fonts on your site:
https://www.screencast.com/t/RG5BJD0Zi
2. Make sure in Typography > Add Font -that the Google Font is NOT Selected.
3. What Add Typography > Select Element did you apply Cairo font to ?
OK, I did what you told me: no cache, Google Font is NOT.
The problem with the Cyrillic character was also with the Oswald font. I reloaded the font with the charset cyrillic + latin-ext and now Oswald is OK.
Is it possible that it depends on the fact that Cairo does not have a cyrillic charset?
Yeah if you're using a Cyrillic character set - then you must use a Font that supports it.
OK, got it.
The font doens't support Cyrillic character set
How do I get a web safe sans-serif font to be used automatically instead of a sans font?
In Cusomizer - Layout, with Google Font -> NOT, I can't choose a font category...
When you Add Font you can add whatever you like in the Font Family Name.
So you could just add:
sans-serif
Or you can create your own stack eg.
"Oswald", sans-serif
More examples of stacks here:
Got it. Now it works. Many thanks.
Glad to hear that