[Resolved] Upload custom fonts

Home Forums Support Upload custom fonts

  • This topic has 5 replies, 2 voices, and was last updated 4 months ago by Elvin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1504038
    sanu kumar

    How can I install Google’s “Inter” font in GP?

    #1504047
    Elvin
    Staff
    Customer Support

    Hi,

    You can try following this documentation:

    https://docs.generatepress.com/article/customizing-the-google-font-list/#adding-your-google-font-to-the-list

    A wise man once said:
    "Have you cleared your cache?"

    #1504054
    sanu kumar

    I added this php but “Inter” font is not showing.

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'zilla_slab' ] = array( 
    		'name' => 'Zilla Slab',
    		'variants' => array( '300', '300i', '400', '400i', '500', '500i', '600', '600i', '700', '700i' ),
    		'category' => 'serif'
    	);
    	
    	return $fonts;
    }
    #1504061
    Elvin
    Staff
    Customer Support

    You have to change the values in it.

    Example: change $fonts[ 'zilla_slab' ] to $fonts[ 'inter' ].

    also since Inter is a san-serif font, change 'category' => 'serif' to ‘category’ => ‘sans-serif’.

    You can also change what font-weights you need on the ‘variants’ value.

    A wise man once said:
    "Have you cleared your cache?"

    #1504065
    sanu kumar

    thank you Elvin

    #1504079
    Elvin
    Staff
    Customer Support

    No problem. 🙂

    A wise man once said:
    "Have you cleared your cache?"

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