[Resolved] Carrois Gothic Font

Home Forums Support Carrois Gothic Font

  • This topic has 5 replies, 2 voices, and was last updated 5 months ago by Leo.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1146175
    Michael

    Hi all,

    I’ve just started with GeneratePress Premium and am slowly attempting to rebuild my Weebly based site (https://www.reclaimdesign.org/) in WordPress. The options in the theme are great, but I noticed I am not able to select Carrois Gothic Google font, only Didact Gothic. My site headers etc are all in Carrois Gothic and I’d like to keep them that way, so is there an easy way to do this from within the theme editor? Many thanks for your help!

    Michael.

    #1146183
    Leo
    Staff
    Customer Support

    Hi there,

    Currently only the top 200 most popular Google Fonts are displayed in the Customizer dropdown list.

    You can add it in with this filter:
    https://docs.generatepress.com/article/customizing-the-google-font-list/#adding-your-google-font-to-the-list

    Let me know if you need help with the code 🙂

    #1146552
    Michael

    Hi Leo, thanks very much. I think I will need a pointer with the code. I’ve installed the snippets plugin, but am not sure about the variants scenario. This is the call to the font in my live site:

    <link href=’//fonts.googleapis.com/css?family=Carrois+Gothic&subset=latin,latin-ext’ rel=’stylesheet’ type=’text/css’ />

    It doesn’t seem to have any variants included? Also, I’m sorry for my limited understanding, but is it possible to remove all the other 200 fonts? I’ll basically only use Carrois Gothic and Open Sans. If I keep the other 200 in there will it slow the site down?

    Thanks very much for your help!

    Michael.

    #1147519
    Leo
    Staff
    Customer Support

    Looks like there is only 1 variant for that font so no need to worry about that.

    This should be your code:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'carrois_gothic' ] = array( 
    		'name' => 'Carrois Gothic',
    		'category' => 'serif'
    	);
    
    	return $fonts;
    }

    All other fonts won’t be loaded unless they are selected in the customizer 🙂

    #1147521
    Michael

    That’s great – thank you Leo

    #1147522
    Leo
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.