[Resolved] New typography manager : impossible to select a custom font added with code

Home Forums Support [Resolved] New typography manager : impossible to select a custom font added with code

Home Forums Support New typography manager : impossible to select a custom font added with code

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1943644
    Jean-Pol

    Hello,
    I add 2 custom fonts with code in style.css and function.php.
    I’m able to choose the fonts in the previous typography menu, but impossible to add them in the new typography manager : not listed.

    Thanks !

    #1943799
    Elvin
    Staff
    Customer Support

    Hi Jean-Pol,

    Can you share the codes you’re currently using? Are you using the code provided here? https://docs.generatepress.com/article/adding-local-fonts/#uploading-our-font

    Let us know. ๐Ÿ™‚

    #1943920
    Jean-Pol

    Here the code :
    in style.css :

    @font-face {
        font-family: 'Honeysail';
        font-style: normal;
        font-weight: 400;
        src: url('https://mysite.com/wp-content/themes/generatepress_child/honeysail.woff2') format('woff2'),
             url('https://mysite.com/wp-content/themes/generatepress_child/honeysail.woff') format('woff');
    }
    
    @font-face {
        font-family: 'Dreamy-Notes-Sans';
        font-style: normal;
        font-weight: 400;
        src: url('https://mysite.com/wp-content/themes/generatepress_child/Dreamy-Notes-Sans.woff2') format('woff2'),
             url('https://mysite.com/wp-content/themes/generatepress_child/Dreamy-Notes-Sans.woff') format('woff');
    }

    and in function.php

    
    function generatepress_child_enqueue_scripts() {
    	if ( is_rtl() ) {
    		wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
    
    add_filter( 'generate_typography_default_fonts', function( $fonts ) {
        $fonts[] = 'Honeysail';
        $fonts[] = 'Dreamy-Notes-Sans';
        return $fonts;
    } );

    The font files : in generatepress_child directory

    All this worked before I check the new typography manager checkbox.

    #1944162
    David
    Staff
    Customer Support

    Hi there,

    in the Font Manager, just enter the Name of your local Font in the field provided, make sure not to check its a Google Font.

    #1944395
    Jean-Pol

    Thanks, Elvin and David !

    Works as expected ๐Ÿ™‚

    Jean-Pol

    #1944796
    Jean-Pol

    Resolved !

    #1944900
    David
    Staff
    Customer Support

    Glad to hear that!

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