Archived topic
Can't add custom font to the customize dropdown
5 replies · Started by Xavier on January 19, 2022
Hello Tom & the band,
- I've been following your tutorial at https://docs.generatepress.com/article/adding-local-fonts/ but without success.
- I'm using Google fonts added with the Theme Customizer
- I've created a child theme with a styles.css and block-editor.css to add local fonts with the following code:
@font-face {
font-family: Graphik;
src: url(fonts/Graphik-Bold.otf);
font-weight: bold;
}
@font-face {
font-family: Graphik;
src: url(fonts/Graphik-Light.otf);
font-weight: 200;
}
@font-face {
font-family: Graphik;
src: url(fonts/Graphik-Medium.otf);
font-weight: medium;
}
@font-face {
font-family: Graphik;
src: url(fonts/Graphik-Regular.otf);
}
- I've updated to GP 3.1.1
... But I can't see the name of the font in the dropdown menu in Customize > Tipography > etc.
Well, actually I can't even see the elements you show in your video tutorial:
https://www.screencast.com/t/nwgeUtnQjlfM
Can you help me please?
Hi there,
click Add Font and in the Font Family field name type in the font family name you have in your @font-face CSS eg. Graphik
Make sure NOT to check Google Font.
And thats it, when you Add Typography your custom font will be available for selection.
Hi David!
Awesome speed! thanks,
Well the problem is that I CAN'T SEE what is shown in the screenshot I've send to you... (Font Manager, add font, typography Manager...)
I click «typography» in the previous menu and... hop! what I see is this:
https://www.screencast.com/t/E6EeM1nzoQg
I don't see the option to uncheck google fonts.
One more point: I use the filter generate_typography_customize_list with the function tu_add_google_fonts in functions.php
Ah - if its a site that was built before GP 3.1 - then you have to enable Dynamic Typography in Customizer > General
All Right!!
It was that. Thanks David!
Very good custom service indeed.
Glad to be of help