Support » Plugin: Asset CleanUp: Page Speed Booster » Combining Google Font requests applies the wrong font-weight

  • Resolved Dekadinious

    (@dekadinious)


    I have this in my header:

    <link href="https://fonts.googleapis.com/css?family=Rubik:400,500&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Lato:400,700&display=swap" rel="stylesheet">

    When turning on the option to combine these requests, the Rubik font in font-weight 500 displays as 400. The Lato font in 700 seems to be displayed correctly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Gabe Livan

    (@gabelivan)

    @dekadinious Thanks for alerting me about a potential bug!

    Please paste here the LINK of the combined requests just like you did for the individual ones. It would be easier to inspect it if I actually have the full LINK tag.

    Nothing like that was reported before so hopefully, this is an isolated case and we will have it resolved as soon as possible.

    Thread Starter Dekadinious

    (@dekadinious)

    I found these two instances of “Rubik”.

    <script id='wpacu-google-fonts-async-load' type='text/javascript'>
    WebFontConfig={google:{families:['Lato','Rubik&display=swap']}};(function(wpacuD){var wpacuWf=wpacuD.createElement('script'),wpacuS=wpacuD.scripts[0];wpacuWf.src=('https:'===document.location.protocol?'https':'http')+'://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';wpacuWf.async=!0;wpacuS.parentNode.insertBefore(wpacuWf,wpacuS)})(document);
    </script>

    AND

    <noscript><link rel='stylesheet' id='wpacu-combined-google-fonts-css' href='https://fonts.googleapis.com/css?family=Lato:400,700|Rubik:400,500&display=swap' type='text/css' media='all' /></noscript>

    Plugin Author Gabe Livan

    (@gabelivan)

    @dekadinious you’re right about that! There’s a bug there. Whenever you use “Asynchronous via Web Font Loader (webfont.js)” with the current version of the plugin, the font-weights would not be applied to the families, only the subsets.

    So, I’ve fixed this in the development version, and it will also be added to the next version of the plugin.

    To fix it, please download the following file https://plugins.trac.wordpress.org/export/2292638/wp-asset-clean-up/trunk/classes/OptimiseAssets/FontsGoogle.php and replace it with the one you currently have which is located in the following directory: /wp-content/plugins/wp-asset-clean-up/classes/OptimiseAssets/

    Once you do this change, the types should show up. Let me know how it goes!

    Plugin Author Gabe Livan

    (@gabelivan)

    @dekadinious Is everything alright now? Let me know at your earliest convenience!

    Thread Starter Dekadinious

    (@dekadinious)

    I am sorry I have not answered this. Time flies!

    I will contact you again here if this is not resolved after I get the chance to test it properly! 🙂

    Hey, I am also facing the same issue. When I combine the google font requests. It loads a heavy font-weight and I guess the same font all over the site. Using Asynchronous via Web Font Loader (webfont.js) seems like the solution. However, it also doesn’t load the actual font.
    In dev tools slow loading, it appears like first the actual font loads and then combines the requests option of this plugin replace it with another font.

    I guess the bug is still there. Please help to resolve.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Combining Google Font requests applies the wrong font-weight’ is closed to new replies.