[Resolved] Full library Google Fonts is not loaded

Home Forums Support Full library Google Fonts is not loaded

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #560230
    Felipe

    I am trying to insert a specific font (IBM Plex Serif), but for some reason it is not loaded correctly.

    I inserted this action into the child theme’s functions.php, but the variants were not loaded on the front end.

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'plex_serif' ] = array( 
    		'name' => 'IBM Plex Serif',
    		'variants' => array( '200', '200i', '300', '300i', '400', '400i', '500', '500i', '600', '600i', '700', '700i' ),
    		'category' => 'serif'
    	);
    	
    	return $fonts;
    }

    And when you enter the action that supposedly lists the entire library, this font still does not appear.

    add_filter( 'generate_number_of_fonts','tu_show_all_available_google_fonts' );
    function tu_show_all_available_google_fonts() {
    	return 'all';
    }

    ibm

    What could be happening?

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #560606
    Tom
    Lead Developer
    Lead Developer

    When you add this function:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'plex_serif' ] = array( 
    		'name' => 'IBM Plex Serif',
    		'variants' => array( '200', '200i', '300', '300i', '400', '400i', '500', '500i', '600', '600i', '700', '700i' ),
    		'category' => 'serif'
    	);
    	
    	return $fonts;
    }

    Can you not select the font and variants within the Customizer?

    #560865
    Felipe

    I replaced the action that loads the entire library, to the above code.
    The font appears in the list, but the variations are not loaded. It is only loaded with normal variation, or 400.

    If in font weight I select bold, it is not changed to weight 600, but rather forced bold. The same thing happens with italics. It can be perceived by the letter A. The italic style has another design and not just slope.

    #561188
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
    function tu_add_google_fonts( $fonts ) {
    	$fonts[ 'ibm_plex_serif' ] = array(
    		'name' => 'IBM Plex Serif',
    		'variants' => array( '200', '200i', '300', '300i', '400', '400i', '500', '500i', '600', '600i', '700', '700i' ),
    		'category' => 'serif'
    	);
    
    	return $fonts;
    }
    #561191
    Felipe

    Worked perfectly!
    Thank you 😀

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