Site logo

Archived topic

Local Google Fonts: what about GenerateBlocks?

9 replies · Started by wo on November 9, 2021

Viewing posts 1–10 of 10

Hi back again,

I thought, I've got it.

Switched GPP to the dynamic typography system and local Google fonts, according to your tutorial.

Great success. PageSpeed Insights jumped right into the green.

Now, I just repeated this procedure, exactly the same, working on another site, this one:

baerbelhirsch.de

But: NO success, so far. PageSpeed Insights still insists, there is a slooow call to fonts.googleapis.com.

And they are right, see page's source:

... 
<link rel='dns-prefetch' href='//fonts.googleapis.com' />
...
<link rel='stylesheet' id='generateblocks-google-fonts-css'  href='https://fonts.googleapis.com/css?family=Roboto:100,100italic,300,300italic,regular,italic,500,500italic,700,700italic,900,900italic&display=swap' media='all' />
...

Both sites are GPP and GB, current versions. Both are AutOptimize. Flushing its cache, even deactivating it, makes no difference. On this site, GB insists on googleapis.com.

What went wrong, this time? How could I figure it out?

Unfortunately, there are some more sites, waiting for local fonts :)

Thanks in advance
Wolfram

Hi there,

the request is being made by the GenerateBlocks plugin, which means there is a GB Block that has the Font set in the blocks Typography settings. If you can disable Autoptimize i can take a look where its coming from.

Hi David,

thanks a lot. AutOpt is de-activated now!

Please let me know, *what* you see :)

Do you have any server side caches ? As i am still seeing autoptimize cached files.

Oppala ... yes. Indeed. This site's hosting _is_ cached. Disabled. Now you should definitely see everything. Pardon!

No problem - that did the trick :)

On the Home Page the Phone Number Button (tel:+4951116290640) - the GB Button Block has the Roboto Font selected in the blocks typography settings. Edit the typography and uncheck the Google Font option.

David, your trick is great again :)

Thanks a lot.

Glad to be of help!

Hello, I tried to follow these instructions as well.

I downloaded the font files, added the temporary script to Code Snippets:

add_filter( 'upload_mimes', function( $mimes ) {
    $mimes['woff']  = 'application/x-font-woff';
    $mimes['woff2'] = 'application/x-font-woff2';
    $mimes['ttf']   = 'application/x-font-ttf';
    $mimes['svg']   = 'image/svg+xml';
    $mimes['eot']   = 'application/vnd.ms-fontobject';

    return $mimes;
} );

I tried to upload the fonts to the Media library. Most of the files uploaded, but the .ttf files would not upload. The error message said, "Sorry, this file type is not permitted for security reasons."

This archived topic is closed to new replies.