[Resolved] Font Styling Question

Home Forums Support [Resolved] Font Styling Question

Home Forums Support Font Styling Question

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1264994
    Karen

    Hi there,

    I’m wondering if you have any ideas for how to get rid of the font flash that initially happens when my website is loaded. I’m using josefin sans and work sans. Is there some css that I can add to load the fonts quicker and avoid FOUT?

    Thanks so much,

    Karen

    #1265249
    Leo
    Staff
    Customer Support

    Hi there,

    Does the issue happen if you disable WP Rocket?

    Let me know ๐Ÿ™‚

    #1265384
    Karen

    Hi Leo,

    It does still happen when disabling WP Rocket. Thanks for your help.

    Karen

    #1265385
    Karen

    I can follow up with them to see if they have any ideas as well.

    #1265571
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This is likely happening because you’re using “swap” in your Google fonts call.

    What happens if you remove this function?:

    add_filter( 'generate_google_font_display', function() {
        return 'swap';
    } );
    #1266427
    Karen

    Hi,

    Thanks for your response. Where is this located so I can remove it?

    #1266874
    Tom
    Lead Developer
    Lead Developer

    It would have been added by you/someone working on your site. Maybe in your child theme functions.php file? Or a plugin named Code Snippets?

    #1267678
    Karen

    Hmmm, I don’t have code snippets anymore but perhaps it was added by a previous child theme. Thanks for your help anyways.

    #1267737
    Tom
    Lead Developer
    Lead Developer

    There are no custom functions added to your site at all?

    #1267784
    Karen

    I never added that custom function in and I’ve been with GP for a little while now. I do have some custom functions but nothing related to font swap. Could it be WP Rocket? I disabled that and tried and a bunch of different settings but still had the same issue. The only time I wasn’t getting the flash was when I was using system stack.

    #1268052
    Tom
    Lead Developer
    Lead Developer

    It looks like the swap parameter is gone now, and I’m no longer seeing the FOUT issue. Is it working on your end now?

    #1269253
    Karen

    It does seem to be working right now. With a slight flash on the logo part, but I’m ok with it. It must have been my WP Rocket settings. Thanks so much for your help!

    Karen

    #1269688
    Tom
    Lead Developer
    Lead Developer

    No problem! ๐Ÿ™‚

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