Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor codersantosh

    (@codersantosh)

    Hello @krzd7,

    Gutentor does not load any fonts by default. It combines all the fonts used in the Gutentor Blocks options uniquely in a single URL string. If Gutentor is loading font the id of the <link> tag should be gutentor-google-fonts and there must be font selected either on Gutentor Global Options typography or Gutentor Blocks Typography Options.
    Please check Global Typography Options or Typography options of every Gutentor blocks you are using.

    Best Regards!

    Thread Starter krzd7

    (@krzd7)

    I tried setting Gutentor blocks and Global settings but it did not unload the Noto Serif font. I’ll check my other plugins but, after setting the Global typography settings from Default to Google (Roboto and Open Sans), Gutentor started adding the following line:

    <link id="gutentor-google-fonts" href="//fonts.googleapis.com/css?family=Open+Sans:regular|Roboto:regular,700" rel="stylesheet" />

    I tried to roll back to “Default” font on all elements, but now I can’t get rid of this css import line.

    Thread Starter krzd7

    (@krzd7)

    I tried a few things, including the wordpress filter_remove (wp_head), but I’m unable to prevent Gutentor from adding this link. I’ve tracked this down to Gutentor’s dynamic-css.php file (enqueue_google_fonts).

    I’m not sure if there is a cache somewhere I need to clean up, considering I already reverted the typography settings to “Default”, but the plugin is still loading the fonts.

    I ended up commenting the includes/dynamic-css.php file, line:
    add_filter( 'wp_head', array( $this, 'enqueue_google_fonts' ), 100 );

    Is there a better way of solving this without editing the plugin files?

    Thanks

    Thread Starter krzd7

    (@krzd7)

    Ok, I managed to find the block using Google fonts.

    Is it possible for you to add a global option on Gutentor plugin settings to “Never import Google fonts” or something like that? Or is there a filter_remove call that would prevent enqueue_google_fonts?

    It could be useful when dealing with other people creating and editing pages/posts. I was trying to optimize theme’s stylesheets itself and it caused an unnecessary overhead (calling Roboto and Open Sans twice).

    Thanks a lot!

    Plugin Contributor codersantosh

    (@codersantosh)

    Hello @krzd7 ,

    It seems like it is bug, we only added google font when it is not empty but forget to delete it when it is empty.
    We will be adding the following code on next version after dynamic-css.php line 483

    else {
        $fonts_url = get_post_meta($post_id, 'gutentor_gfont_url', true );
        delete_post_meta( $post_id, 'gutentor_gfont_url', $fonts_url );
        $message[] = __( 'Google fonts is empty', 'gutentor' );
    }

    Best Regards!

    Thread Starter krzd7

    (@krzd7)

    Thanks, I’ll take a look after the next update.

    Plugin Contributor codersantosh

    (@codersantosh)

    Hello @krzd7,
    We have fixed Google font not deleting when it is an empty issue and also added filter hook gutentor_google_fonts, hoping it will help developers like you to further modification of Gutentor Google font.

    Best Regards!

    Thread Starter krzd7

    (@krzd7)

    Hello,

    I have tested and it works!

    Thanks a lot.

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