Site logo

Archived topic

add local font to generateblock dropdown

11 replies · Started by jasond on July 10, 2020

Viewing posts 1–12 of 12

Hello

I already installed custom fonts into Customizer, how can I add it to Advanced Typography dropdown In GenerateBlocks without having to type the font name every time.

add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Custom Font';
return $fonts;
} );

Many thanks

Hi there,

As of right now there are no filters for that, but we'll definitely be adding one :)

Many thanks Tom, any ETA for this?

Not at the moment - will see if I can get it added in 1.2 :)

Is this already implemented?

Any news on this? I have version 1.3.3 but I can't see my installed custom font in the dropdown of Typography. When I manually type it in the box below Font Family it works but only on the front of the webpage, I can't see a preview while editing the page.

Thanks Tom, that worked! Indeed I wanted the preview in the editor. The quick select would also be nice, but the preview is great ;-)

I think adding fonts in the Asset Library in GB Pro will be a thing soon :)

Hello,

Why not just adding a simple filter please ?


import {
	applyFilters,
} from '@wordpress/hooks';

[...]

const fonts = applyFilters( 'generateblocks.editor.fonts', [
			{ value: '', label: __( 'Select font', 'generateblocks' ) },
			{ value: 'Arial', label: 'Arial' },
			{ value: 'Helvetica', label: 'Helvetica' },
			{ value: 'Times New Roman', label: 'Times New Roman' },
			{ value: 'Georgia', label: 'Georgia' },
		]);

Hi there,

Agreed - this needs a filter. Will implement in 1.5.0.

Thanks!

This archived topic is closed to new replies.