Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Custom Fonts issues

  • Hallo I have followed the instructions of GP for the local custom fonts, but I cant make them work on my editor.

    What I have done till now is this

    style.css ( Child Theme )

    /* PFBagueSansPro - Regular */
    @font-face {
        font-family: 'PFBagueRegular';
        font-style: normal;
        font-weight: 400; /* Regular */
        src: url('/wp-content/themes/generatepress_child/fonts/PFBagueSansPro-Regular.otf') format('opentype');
    }
    
    /* PFBagueSansPro - Bold */
    @font-face {
        font-family: 'PFBagueSansPro';
        font-style: bold;
        font-weight: 700; /* Bold */
        src: url('/wp-content/themes/generatepress_child/fonts/PFBagueSansPro-Bold.otf') format('opentype');
    }
    
    /* PFBagueSansPro - Black */
    @font-face {
        font-family: 'PFBagueBlack';
        font-style: normal;
        font-weight: 700; /* Black */
        src: url('/wp-content/themes/generatepress_child/fonts/PFBagueSansPro-Black.otf') format('opentype');
    }
    
    @font-face {
        font-family: 'PFBagueBlackBold';
        font-style: normal;
        font-weight: bold; 
        src: url('wp-content/themes/generatepress_child/fonts/PFBagueSansPro-Bold.otf') format('opentype');
    }
    

    Functions PHP

    add_filter( 'generate_editor_styles', function( $editor_styles ) {
        $editor_styles[] = 'style.css';
    
        return $editor_styles;
    } );
    

    Which by the way does not show the available fonts on the customizer and its font weights, but If I write it down it works – but still on the front end.

    Thanks in advance

  • Hi there,

    Which by the way does not show the available fonts on the customizer

    You need to type the local fonts and weights into your typography system, then you can select the font for different elements.
    https://docs.generatepress.com/article/adding-local-fonts/#adding-our-font

    The PHP looks correct, maybe try using the full URL for the font files in your CSS.

    Let me know if that works!

  • Hello,
    I am using the full url, just removed it for your preview.

    You need to type the local fonts and weights into your typography system

    Sorry but I dont understand what are you saying here.

  • Sorry, as I get you mean to type exactly the font name, yes this is what i do and it work but it cant recognise exactly the fonts, meaning that it does not show up as you mention on your video tutorial.

    Thats the reason I shared with you the font css.

    Please let me know

    Thanks

  • but it cant recognise exactly the fonts, meaning that it does not show up as you mention on your video tutorial.

    Sorry, I don’t understand, what do you mean by it can’t recognize exactly the fonts?

  • Hey, sorry for the inconvenience

    I mean I cant find the font when I search on the customizer, the PHP function is not supposed to do that?

  • I mean I cant find the font when I search on the customizer

    The font will not show in the dropdown list, you need to manually type the font by clicking the add font button. Can you check this link?https://docs.generatepress.com/article/adding-local-fonts/#adding-our-font

    the PHP function is not supposed to do that?

    No, it doesn’t.

    The PHP is to apply the font to the text in the block editor, as by default, the local fonts will not apply to text in the block editor.

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