Site logo

Archived topic

Adding local font to GenerateBlocks Advanced Typography?

8 replies · Started by Teresa on March 31, 2020

Viewing posts 1–9 of 9

I've (successfully) added a local font to my site (stupid typos and PBKAC notwithstanding) and it shows up in the Customizer (and site) fine. Wondering how I can do the same in the Advanced Typography section of GB.

The font doesn't appear in the menu and when I try to input the font name in the box it doesn't seem to take.

If this is a "we're on it, coming soon" feature, cool I can be patient.

All the above said, I'm finally getting the swing of creating nice landing pages with a lot less swearing than last week! http://www.trustglobalwireless.com/

Hi there,

This is because the @font-face CSS isn't loading in the block editor.

How are you adding that CSS right now? A child theme or another method?

Hi Tom, Greetings from the other side of Georgia Straight! I added the local fonts via your handy tutorial (into a child theme).

It's more annoying than anything else. I've set all the fonts in the Customizer so it doesn't really matter, but nice to see how things look.

Totally - give this a shot:

add_action( 'enqueue_block_editor_assets', function() {
    wp_enqueue_style( 'your-handle-here', get_stylesheet_directory_uri() . "/block-editor.css", false, '1.0', 'all' );
} );

Then add block-editor.css in your child theme, and include the @font-face CSS (and any other CSS you want to load in the editor).

Let me know if you need more info :)

Awesome! I'll give it a shot! Thanks Tom.

Awesome! Glad I could help :)

Hello,

I'm sorry to open this topic but I block that the addition of my font.
Can you be more explicit than:
Then add block-editor.css in your child theme, and include the @font-face CSS (and any other CSS you want to load in the editor).

I have added the php code that you quote in the "Code snippets" help but I don't know how to do the rest of the explanations.

Thanks in advance for the help

This archived topic is closed to new replies.