• ChatGPT helped me identify an issue which I thought was due to a page builder update (Breakdance), but was due to Autoptimise combining Google Fonts requests. The font ‘Merriweather’ was loading but “Merriweather Sans’ was not. I have fixed this on my site (by turning off Autoptimse’s google font handling) but I’m sharing it for others / the developers, in case it is helpful.

    ChatGPT said (amongst lots of other stuff that wasn’t true!)

    2. The Google Fonts URL is malformed

    This part caught my eye:

    Merriweather Sans:300..800,italic300..800

    For variable fonts Google normally expects something like

    family=Merriweather+Sans:ital,wght@0,300..800;1,300..800

    whereas the Merriweather request underneath is in the newer format:

    family=Merriweather:ital,opsz,wdth,wght@...

    So the URL is mixing two different syntaxes. Modern Google Fonts is fairly forgiving, but it’s possible Autoptimize has generated an invalid URL for Merriweather Sans.

    This is the full code from the page source:

    <link rel="stylesheet" media="print" onload="this.onload=null;this.media='all';" id="ao_optimized_gfonts" href="https://fonts.googleapis.com/css?family=Merriweather Sans:300..800,italic300..800%7CMerriweather:ital,opsz,wdth,18..144,87..112,300..900,italic18..144,87..112,300..900&amp;display=swap">

    • This topic was modified 1 week, 1 day ago by retrocool. Reason: Added original source code in full
Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    interesting, thanks for reporting @retrocool ! the Google Font optimization code indeed could do with some TLC.

    could you copy/ paste full URL’s (or full link tags) for the non-optimized Google Font calls?

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.