[Support request] Adding italic variant Google font

Home Forums Support Adding italic variant Google font

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1303833
    mariela

    Hi, Support.

    I added the filter for a Google font that is not in your theme (added it in the functions.php of the Child theme). The font is loading correctly, but I cannot get the italic to load. I have tried adding ‘400italic’, ‘700italic’ to the variants with no luck. Can you help?

    This is the font I’m adding: https://fonts.google.com/specimen/Aleo

    And this is the code I have added to functions.php:

    /*add Aleo font*/
    add_filter( ‘generate_typography_customize_list’, ‘tu_add_google_fonts’ );
    function tu_add_google_fonts( $fonts ) {
    $fonts[ ‘aleo’ ] = array(
    ‘name’ => ‘Aleo’,
    ‘variants’ => array( ‘300’, ‘300italic’, ‘400’, ‘500’, ‘700’, ‘700italic’, ‘800’, ‘900’, ),
    ‘category’ => ‘serif’
    );

    return $fonts;
    }

    #1304134
    Leo
    Staff
    Customer Support

    HI there,

    Can you try 300i instead of 300italic as suggested here?
    https://docs.generatepress.com/article/customizing-the-google-font-list/#adding-your-google-font-to-the-list

    Let me know if this helps 🙂

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