Site logo

Archived topic

Adobe Typekit in generateblocks

5 replies · Started by Heinrich on February 25, 2020

Viewing posts 1–6 of 6

hi team,

want to use adobe fonts in blocks (button). fonts are added and working fine in customizer. if i try to create a button in blocks, the defined font is not used and i can`t find my adobe font in advanced typo. any idea?

Hi there,

You would need to load the Typekit javascript inside the block editor. How are you adding it to the front-end of the site currently?

hi tom,

i integrate the fonts in two steps:

1. step: a hook: <link rel="stylesheet" href="https://use.typekit.net/xxxxxxxx.css">
2. snippet to add the fonts in the customizer:
add_filter( 'generate_typography_default_fonts', 'tu_add_typekit_fonts' );
function tu_add_typekit_fonts( $fonts ) {
$fonts[] = 'itc-fenice';
$fonts[] = 'trade-gothic-next';

return $fonts;
};

seems i need a third step?

You need to hook the Typekit URL into the block editor:

add_action( 'enqueue_block_editor_assets', function() {
    wp_enqueue_style( 'typekit', 'https://use.typekit.net/xxxxxxxx.css' );
} );

Then just add your font family name into the Font family field.

In the Select font... field change this to Other
And then in the field you have highlighted add your Typekit Font name

This archived topic is closed to new replies.