[Resolved] Add a Google Font (and Variants) to the Google Font List

Home Forums Support [Resolved] Add a Google Font (and Variants) to the Google Font List

Home Forums Support Add a Google Font (and Variants) to the Google Font List

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2054935
    twarrior

    Hello,

    I have followed https://docs.generatepress.com/article/customizing-the-google-font-list/ to add Red Rose Font

    Add this with CodeSnippets:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'red_rose' ] = array( 
    		'name' => 'Red Rose',
    		'variants' => array( '400', '500', '700' ),
    		'category' => 'sans-serif'
    	);
    
    	return $fonts;
    }

    I can see the Red Rose in the font lists, but I can not see any variants:
    variants

    And if i select 700, i see this strange behaviour only in some letters:
    font

    #2055008
    Ying
    Staff
    Customer Support

    Hi there,

    Make sure you are following the instruction from this link: https://docs.generatepress.com/article/adding-local-fonts/

    1. You don’t need the PHP snippet to add the font to fonts list if you GP version is 3.1.0 or above (make sure you are using the new typography system), you just need to add the font name to the font family name field:https://www.screencast.com/t/DajKUtfYM

    2. If your font uploaded and @font-face CSS installed correctly, the variants should be there.

    Let me know if you need further assistance πŸ™‚

    #2055034
    twarrior

    thanks for replying, but I’m sorry but I don’t understand you.
    Why should I follow the “add a local font” tutorial https://docs.generatepress.com/article/adding-local-fonts/? Isn’t it better to use the Google Fonts service?

    #2055098
    Ying
    Staff
    Customer Support

    Oh so you are not using local fonts? Sorry I misunderstood the question.

    Then it’s even easier πŸ™‚

    You don’t need to use any PHP filter or CSS at all, you just need to enter the google font name in the typography system, I shot a small clip for you:
    https://www.screencast.com/t/Gmu1nwHGVd

    Let me know if this helps πŸ™‚

    #2055402
    twarrior

    Thanks you

    RESOLVED!

    #2055943
    Ying
    Staff
    Customer Support

    Great!

    You are welcome πŸ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.