Site logo

[Support request] Ensure text remains visible during webfont load issue

Home Forums Support [Support request] Ensure text remains visible during webfont load issue

Home Forums Support Ensure text remains visible during webfont load issue

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1718607
    max

    hi how to solve this Ensure text remains visible during webfont load issue that we check from gtmetrix
    thank you for your respond

    #1718615
    Elvin
    Staff
    Customer Support

    Hi there,

    There are different fonts being flagged.

    1 is the Google font in use and the other is the GP font you use as an icon.

    For the GP font icons:

    Try changing the icons being used to SVG. This can be set through Appearance > Customize > General
    https://docs.generatepress.com/article/svg-icons/

    For the google font:
    We can add font swap to the requested google font by using this PHP snippet.

    add_filter( 'generate_google_font_display', function() {
        return 'swap';
    } );
    #1718618
    max

    this need to put at which area?

    add_filter( ‘generate_google_font_display’, function() {
    return ‘swap’;
    } );

    #1718682
    Elvin
    Staff
    Customer Support

    this need to put at which area?

    add_filter( ‘generate_google_font_display’, function() {
    return ‘swap’;
    } );

    Here’s how to add PHP snippets – https://docs.generatepress.com/article/adding-php/

    You can put it on your child theme’s functions.php or a Code Snippets plugin.

    #1718846
    max

    So after i put this code, al error from gtmetrix for Ensure text remains visible during webfont load issue will resolve?

    #1718885
    David
    Staff
    Customer Support

    Hi there,

    it looks like its flagging the GP Icon fonts issue… don’t bother adding the code Elvin provided.
    Instead go to Customizer > General and change the Icon Type to SVG.

    Make sure you clear ALL caches and refresh CDN ( if its being used )

    #1718926
    max

    Just want to reconfirm
    I didnt need to put that code
    Just change
    Icon Type to SVG

    #1718943
    David
    Staff
    Customer Support

    Thats correct.

    #1718946
    max

    Thank you team
    Tremendous respond

    #1718965
    David
    Staff
    Customer Support

    Glad we could be of help.

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