• Resolved wpwebdevj

    (@wpwebdevj)


    In Kadence settings I only have 1 font selected (Nunito). I also have these 2 settings enabled in performance.

    Load Google fonts locally
    Preload local fonts

    In the front end of my site, the following html is generated

    </style><link rel="preload" href="https://example.com/wp-content/fonts/nunito/XRXW3I6Li01BKofAjsOUYevI.woff2" as="font" type="font/woff2" crossorigin><link rel='stylesheet' id='kadence-fonts-css' href='https://example.com/wp-content/fonts/11608fffcf22f1c082cbb3e79c2445d1.css?ver=1.0.26' media='all' />

    The css file is loading a second font file XRXV3I6Li01BKofINeaB.woff2.

    Are both of these needed? Is it possible to only load 1 font file?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    Thank you for reaching out to us.

    The .woff2 font file will be added when you enable the preload font option. This is to instruct browsers to load the font before loading all the page content to avoid FOIT/FOUT performance issues.

    If you want to remove this, you may disable the preload font option.

    Hope this clarifies and let us know if we can assist you further.

    Regards,
    Karla

    JoshLevelUp

    (@joshlevelupsupport2021)

    Sorry please just ignore this reply. I did not notice Karla’s reply to your concern.

    Thread Starter wpwebdevj

    (@wpwebdevj)

    Hello,

    Thanks for the replies, but I am still getting 2 separate woff2 fonts downloaded, even when disabling the preload option.

    The only difference with preload disabled is that both of them are loaded from css instead of 1 loaded from html and 1 loaded from css.

    Here is a test site with a fresh install of WordPress and your theme with no plugins or settings changed except for setting the font and the Load Google fonts locally option (preload local fonts is disabled).

    https://kadence.anon4.com/

    You can see there are 2 separate woff2 font files downloaded when loading the site.

    XRXV3I6Li01BKofINeaB.woff2

    XRXW3I6Li01BKofAjsOUYevI.woff2

    After checking the CSS file that these are loaded from, it appears one is a 700 weight and the other is a 400 weight. The default weights for everything in the typography settings is 700 so I’m not sure if this 400 weight is needed or not?

    If both of these are actually required, then shouldn’t they both preload when the preload local fonts setting is on? Instead of only 1 preloading and 1 loading from css?

    If possible, I prefer to only load 1 .woff2 file instead of 2.

    Hey,
    400 is regular, 700 is bold, when you set the body font it’s going to load both so you can have normal and bold text on your site. While you could use a filter to force out 400 I do not recommend it as all your body text would then appear bold.

    Yes ideally both should preload, I’ll put this on my list to fix.

    Ben

    Thread Starter wpwebdevj

    (@wpwebdevj)

    Ok, thanks. While you are working on a fix, is there a workaround to preload both fonts in the meantime?

    I don’t have a workaround without manually coding it. I will however have an update out tomorrow morning which includes this fix.

    Ben

    Just to follow up, that fix is out.

    Ben

    Thread Starter wpwebdevj

    (@wpwebdevj)

    Wow that was fast!

    Thanks for the quick support. I’m loving your theme so far. I think it’s great that you offer options like this (loading Google fonts locally), which require a lot of research and manual coding with other themes. And nice to see that you are actively and quickly fixing bugs.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Why are 2 font files loaded?’ is closed to new replies.