[Resolved] Add font-display: swap to locally hosted fonts

Home Forums Support [Resolved] Add font-display: swap to locally hosted fonts

Home Forums Support Add font-display: swap to locally hosted fonts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1151081
    24xstudio

    Hey,

    I want to add font-display: swap to all the locally hosted fonts., font Awesome Icons

    Is there any way of doing this? Without manually editing each font file.

    Thanks

    #1151467
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can add this to your @font-face declarations in the CSS.

    So if it’s a locally hosting font, it means you’ve done something like this:

    @font-face {
        font-family: My Font Name;
        ...etc...
    }

    Just update it like this:

    @font-face {
        font-family: My Font Name;
        font-display: swap;
        ...etc...
    }

    Hope this helps ๐Ÿ™‚

    #1151939
    Ferhat

    Hi,
    i tried the same and even when i added the css code above to my main stylesheet google pagespeed tester is still showing that issue on my site.

    On this page it says that you have to do an additional task to make sure the pagespeed-speed issue will not come again: https://web.dev/font-display/ (Headline: Google Fonts in the middle of the page).
    Where do i have to add that: &display=swap parameter on my site?

    My Site is https://www.nebenbeionline.de and i want to make sure that my Site is running fast like hell :).

    regardly
    Ferhat

    #1152282
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The first font it’s mentioning are our theme icons. Instead of using font-display, use our SVG icons: https://docs.generatepress.com/article/svg-icons/

    The last font it’s mentioning are the social icons by your Social Icons by WPZoom plugin.

    #1155758
    Ferhat

    Thanks Tom! And keep up the good work.

    #1156086
    Tom
    Lead Developer
    Lead Developer

    No problem! Thank you ๐Ÿ™‚

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