• Resolved queso

    (@queso)


    Would also be great (especially with so many people focused on load speed and SEO) if we could append the &text parameter per font so we can subset further.

    Ex. Just to give a real world example, one font I’m including on the website for 9 letters on the entire site is 61 KB for the full WOFF2 latin subset. But with the &text parameter limited to just those 9 letters, it’s only 8 KB!

    If you’re not familiar it’s described at: https://developers.google.com/fonts/docs/getting_started#optimizing_your_font_requests

    I suggested “custom URL” parameters rather than just the text one because there are a few others like their new beta font =effects parameter (described further down on same link) and so just having a freetext field to add parameters would probably save you from further updates in the future when additional features are added.

    Thanks and keep up the great work!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Daan from Daan.dev

    (@daanvandenbergh)

    This isn’t supported yet by the Google Fonts Helper API, it’s a feature request in its Github repository, though.

    As soon as it’s implemented I’ll look into a way to implement it into OMGF.

    Thread Starter queso

    (@queso)

    OOO didn’t realize the plugin was using that API. Unfortunately then I doubt it will happen at all then. That project hasn’t had a commit since 2017. Thx

    Plugin Author Daan from Daan.dev

    (@daanvandenbergh)

    I’m looking into ways to use Google’s own API, but that’ll take a while to implement. I’ll keep this on my to-do, though. 🙂

    Thread Starter queso

    (@queso)

    Not that it is a direct answer but i looked at the API and it didn’t so much seem like there was a way that I could figure out. Seemed like the only way was to pull the .css from multiple user agents and then pull the urls out of the resulting file and fetch them. I believe thats also how the API worked. Probably better answer would be for the API to implement it but seems like that project died off unfortunately. Seems like it would be fairly easy to implement on the original project but it’s definitely above my skill level (have already looked at the code).

    Sad part is for example my website is primarily using Assistant font which I found out the Latin codeset seems to include the hebrew alphabet as well. So it’s not just a few letters extra, I could cut the file size in half.

    Plugin Author Daan from Daan.dev

    (@daanvandenbergh)

    I’m pretty sure Hebrew is a separate subset with Assistent. How did you come to the conclusion that the Latin subset also includes Hebrew?

    Edit, it seems that when you choose latin, it loads all subsets in the resulting CSS-file in the Google API. With Open Sans it does the same thing. What is strange as well, is that e.g. the Cyrillic font file is much smaller than the Latin font file.

    This is pretty interesting and deserves some further testing.

    Plugin Author Daan from Daan.dev

    (@daanvandenbergh)

    FYI, I downloaded both files separately and converted them to TTF. It appears that Assistant Latin only includes Latin and the separate subset Hebrew only includes Hebrew.

    No need to worry about excessive file sizes. 🙂

    Thread Starter queso

    (@queso)

    Sorry not Hebrew but definitely excessive. So the easiest tool I’ve found for this is
    https://fontdrop.info/ Just drag it there and you can see all the glyphs. All 230 of them… 26 letters in the US english alphabet + the caps variations, 0-9 and the few punctuation symbols… Realistically there should be less than 100 glyphs if my quick math is remotely accurate.

    Now if you want to see how big an impact it can make in the real world, take a look at these 4 files: https://imagez.strangled.net/fonts.zip

    1) on my site I’m using just the letters Mentoring in Caveat font. It’s not being used anywhere else on the site literally just used a few different places on the front page (above the fold too and it’s such a stylized font that using =swap is HIGHLY noticeable.

    2) I did a quick and dirty subset of Assistant using the official Google route to just “US” english letters plus common punctuation and symbols (and included the file as pulled by OMGF through the heroku api. I missed a few of symbols but if you drag these to one of these tools above or below you can see its pretty darn close…

    Let me know what you think 🙂

    Bonus: Here’s a few additional sites that you may find helpful:
    http://torinak.com/font/lsfont.html
    https://www.fontsquirrel.com/tools/webfont-generator (not sure if you can see the individual glyphs but if you click expert and drag the font it will show you the same 230 # as the others.)
    https://everythingfonts.com/ttfdump <– not visual but will dump literally all the codes and mapping tables out of a font file.
    https://fontforge.org/en-US/downloads/ <— a full featured font editor

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Custom URL Parameters / Text Subsetting’ is closed to new replies.