• Client site has this font URL enqueued:

    https://fonts.googleapis.com/css?family=Merriweather+Sans:300,400,400italic,600,700%7cArmata:300,400,400italic,600,700

    Plugin creates font.css with all the same local src url for weight 300, 400, 600, 700, example:

    font-weight: 600;
    src: url(https://example.com/wp-content/uploads/fonts/ed3c47daa82ea1e6b2d98e35f38c7c66/merriweather-sans-latin-ext-v22-normal-300.woff2?c=1671122013) format('woff2');

    File merriweather-sans-latin-v22-normal-600.woff2 and also 400/700 are also there in local folder, but have same size/content as 300, which is wrong.

    Local Google Fonts 0.20.0

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author EverPress

    (@everpress)

    Hi There!

    Thanks for your feedback!

    The different font weights actually use the same font file. LGF just named it with *-300-* as it’s the first occurrent to make it unique to other files.

    Please check the original source

    https://fonts.googleapis.com/css?family=Merriweather+Sans:300,400,400italic,600,700%7cArmata:300,400,400italic,600,700

    and search for this font source

    https://fonts.gstatic.com/s/merriweathersans/v22/2-c99IRs1JiJN1FRAMjTN5zd9vgsFHX1QjXp8Bte.woff2

    You can find them multiple times in the source. LGF basically just replaces the links to these files to the ones which were downloaded before.

    Hope that helps!

    Thread Starter Ov3rfly

    (@ov3rfly)

    Original source shows different src url for 300, 400, 600, 700 here:

    /* latin */
    @font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 300;
    src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-cO9IRs1JiJN1FRAMjTN5zd9vgsFF_5asQTb6hZ2JKZ_O4ViesH.woff2) format('woff2'); /* latin */
    @font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-cO9IRs1JiJN1FRAMjTN5zd9vgsFF_5asQTb6hZ2JKZou4ViesH.woff2) format('woff2'); /* latin */
    @font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 600;
    src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-cO9IRs1JiJN1FRAMjTN5zd9vgsFF_5asQTb6hZ2JKZfOkViesH.woff2) format('woff2'); /* latin */
    @font-face {
    font-family: 'Merriweather Sans';
    font-style: normal;
    font-weight: 700;
    src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-cO9IRs1JiJN1FRAMjTN5zd9vgsFF_5asQTb6hZ2JKZRekViesH.woff2) format('woff2');
    Plugin Author EverPress

    (@everpress)

    Looks like you are getting a different version as I do. Google servers serve a certain type based on the browser agent.

    Note that most modern browsers support unicode range but your’s maybe not.

    Here’s what I get and LGF:

    /* latin */
    @font-face {
      font-family: 'Merriweather Sans';
      font-style: normal;
      font-weight: 300;
      src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-c99IRs1JiJN1FRAMjTN5zd9vgsFHX1QjXp8Bte.woff2) format('woff2');
      unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }
    /* latin */
    @font-face {
      font-family: 'Merriweather Sans';
      font-style: normal;
      font-weight: 400;
      src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-c99IRs1JiJN1FRAMjTN5zd9vgsFHX1QjXp8Bte.woff2) format('woff2');
      unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }
    /* latin */
    @font-face {
      font-family: 'Merriweather Sans';
      font-style: normal;
      font-weight: 600;
      src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-c99IRs1JiJN1FRAMjTN5zd9vgsFHX1QjXp8Bte.woff2) format('woff2');
      unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    
    /* latin */
    @font-face {
      font-family: 'Merriweather Sans';
      font-style: normal;
      font-weight: 700;
      src: url(https://fonts.gstatic.com/s/merriweathersans/v22/2-c99IRs1JiJN1FRAMjTN5zd9vgsFHX1QjXp8Bte.woff2) format('woff2');
      unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    }
    Thread Starter Ov3rfly

    (@ov3rfly)

    Have simply not quoted the unicode-range and closing } char in above examples.

    Using Firefox 108.0, latest release.

    Also getting different .woff2 files for 300, 400, 600, 700 at google-webfonts-helper service.

    Edit: Seems your plugin uses hardcoded user agent for Apple to get the Google stylesheet while the above widely used service uses an older Firefox ua, probably due to reasons, see also comments there.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Bug, wrong same file for all weights used’ is closed to new replies.