• Resolved rinart73

    (@rinart73)


    Theme: GeneratePress (free version)
    Fonts: PT Serif, Roboto

    Errors:
    When I enable OMFG plugin it successfully downloads and replaces Google Fonts. But the document fails to use them and instead uses fallback fonts (sans-serif) for some reason. There are no errors anywhere.
    I attached the link to my demo website.

    Suggestions:
    Have you though about adding theme version or filemtime to the CSS file path? With this you can make sure that a visitor browser will use the latest version of the CSS file and not just take one from browser cache.
    So instead of this:
    https://example.com/wp-content/uploads/omgf/generate-google-fonts/generate-google-fonts.css
    have something like this:
    https://example.com/wp-content/uploads/omgf/generate-google-fonts/generate-google-fonts.css?1646853077

    • This topic was modified 4 years, 3 months ago by rinart73.
    • This topic was modified 4 years, 3 months ago by rinart73.
    • This topic was modified 4 years, 3 months ago by rinart73.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter rinart73

    (@rinart73)

    UPDATE: It’s not GeneratePress theme fault.

    This is a description of a feature available only in Pro version:
    “If a theme or plugin loads subsets you don’t need, use this option to force all Google Fonts to be loaded in the selected subsets. You can also use this option to force the loading of additional subsets, if a theme/plugin doesn’t allow you to configure the loaded subsets.”

    This description is a bit confusing. OMGF doesn’t even try to parse subsets query from the original CSS (especially since Google.Fonts removed that query parameter) and just always defaults to “latin”. This makes free version almost unusable on websites that use something else than “latin”. Luckily I was able to find the omgf_optimize_query_subset. Please don’t remove it.

    add_filter('omgf_optimize_query_subset', function ($subset) {
      if (empty($subset) or $subset === 'latin') {
        $subset = 'latin,cyrillic';
      }
    
      return $subset;
    });
    • This reply was modified 4 years, 3 months ago by rinart73.
    • This reply was modified 4 years, 3 months ago by rinart73.
    • This reply was modified 4 years, 3 months ago by rinart73.
    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Hey! You’re right. Sorry about that.

    At this point, OMGF kind of assumed the subset parameter in the Google Fonts API request was always set. If it wasn’t, it would fallback to latin.

    I’ve created a beta which includes a fix for the issue you’re having. If no subset parameter is set, it downloads the font files in all available subsets for that font, to make sure all characters are supported.

    Would you like to try it out?

    You can download it here.

    Let me know how it goes!

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    especially since Google Fonts removed that query parameter

    Thanks for that, btw. I wasn’t aware of that. I think the beta resolves this issue, wouldn’t you agree?

    Thread Starter rinart73

    (@rinart73)

    I haven’t tried it yet, but I will. Yes, downloading all subsets by default (which is identical to how Google.Fonts work) is fine.

    Thank you for a quick response.

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Sure! No problem, looking forward to your findings.

    Thread Starter rinart73

    (@rinart73)

    I checked and it seems that everything works fine.

    Plugin Author Daan van den Bergh

    (@daanvandenbergh)

    Great to hear! These changes will be included with the next patch release (5.0.5)

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘An issue with Generatepress theme’ is closed to new replies.