[Resolved] Adding additional google fonts to the customizer

Home Forums Support [Resolved] Adding additional google fonts to the customizer

Home Forums Support Adding additional google fonts to the customizer

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #913089
    Donna

    Hi there!

    What’s the easiest/best way to add a google font to the customizer if it’s not already listed?

    Thanks!

    Donna

    #913143
    David
    Staff
    Customer Support

    Hi there,

    You would need to add one of the PHP function filters listed here:

    https://docs.generatepress.com/article/customizing-the-google-font-list/

    #913534
    Donna

    Thank you so much! Where do I find the information to include such as the variants and array?

    Donna

    #913535
    Leo
    Staff
    Customer Support
    #913544
    Donna

    HI Leo, thank you!

    Sorry for the confusion! I know how to add PHP; I wanted to know where do I find the Google Font values for variants, etc. as seen in this example:

    add_filter( ‘generate_typography_customize_list’, ‘tu_add_google_fonts’ );
    function tu_add_google_fonts( $fonts ) {
    $fonts[ ‘david_libre’ ] = array(
    ‘name’ => ‘David Libre’,
    ‘variants’ => array( ‘400’, ‘500’, ‘700’ ),
    ‘category’ => ‘serif’
    );

    Donna

    return $fonts;
    }

    #913575
    Leo
    Staff
    Customer Support

    Ahh sorry for the misunderstanding.

    You can find what’s available through Google. For example:
    https://fonts.google.com/specimen/David+Libre

    Then I believe 400 is regular, 500 is medium and 700 is bold:
    https://docs.generatepress.com/article/google-font-variants/

    Let me know if this helps ๐Ÿ™‚

    #913707
    Donna

    Thank you so much!

    #913728
    Leo
    Staff
    Customer Support

    No problem ๐Ÿ™‚

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