[Resolved] Open Sans – Latin Extended Subset

Home Forums Support [Resolved] Open Sans – Latin Extended Subset

Home Forums Support Open Sans – Latin Extended Subset

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #388322
    AMBTL

    Hi,

    My issue is probably quite rare and not very serious, but I would like to optimize it nevertheless.

    Not counting a few FontAwesome icons, I only use Open Sans on the site.
    I set up Open Sans everywhere in Typography Options.
    I thought everything was fine, until I tested the site in MS Edge.
    I frequently use non-English characters, such as Č, Ř, Ě – and Edge inserted these letters from some funky font instead of Open Sans, which looked quite bad. Opera/Firefox don’t have this issue.

    So, here is what I did: In GP Hooks I imported this to the head:

    <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600,700,800&subset=latin-ext" rel="stylesheet">

    And it works, Edge displays the pages correctly, but as far as I can tell Open Sans is loaded twice. Once the regular set, and then Latin-Extended.

    Google PageSpeed Insights tell me:

    Optimize CSS Delivery of:

    https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,regular,italic,600,600italic,700,700italic,800,800italic%7COpen+Sans:400,400i,600,700,800&subset=latin-ext

    which shows that

    Open+Sans:300,300italic,regular,italic,600,600italic,700,700italic,800,800italic

    from the regular subset are being loaded. My site doesn’t need them, when I import 400,600,700,800 from the Latin Extended subset.

    Perhaps, there is some trick:
    a) to make GP load Open Sans-Latin Extended or
    b) to make GP not to load Open Sans at all, because it is imported via GP Hooks

    Or perhaps there is a better way?

    I would like to make the site as fast as possible and avoid unnecessary file requests.

    Cheers
    Tom

    #388427
    Tom
    Lead Developer
    Lead Developer

    You can tell GP to use your needed subset using this filter: https://docs.generatepress.com/article/generate_fonts_subset/

    Let me know if you need more info πŸ™‚

    #390240
    AMBTL

    Thank you very much, Tom. As far as I can tell, it’s working fine.
    Is there also a simple way to get rid of 300, 300 italic, 800 italic, which I don’t use and am unlikely to use in the future?

    #390309
    Tom
    Lead Developer
    Lead Developer

    Yep, check the variants for your selected font: https://docs.generatepress.com/article/google-font-variants/

    #390310
    AMBTL

    Oh, got it. Didn’t see that before in Typography. Fantastic. Thanks πŸ™‚

    #390335
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

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