Use woff2 format for RobotoFlex font #4
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3
What a ride!
I initially attempt a conversion to woff2 with https://www.fontsquirrel.com/tools/webfont-generator from the original ttf https://github.com/googlefonts/roboto-flex/tree/main/fonts
My issue with that option: it was not keeping relevant axis and there are so many of them anyway by default (13! see https://wakamaifondue.com/ for details) so I tried to slice the font prior to that with https://slice-gui.netlify.app/ which did the job but I eventually found the related bug on the Roboto repository googlefonts/roboto-flex#367 and I end up forging that URL:
https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght,GRAD@8..144,100..1000,-200..150&display=swap
Which contains the 3 pertinent grades for our case, then select the URL from the /* latin */ part :
https://fonts.gstatic.com/s/robotoflex/v26/NaNeepOXO_NexZs0b5QrzlOHb8wXqDGRY6mZsaJ8__OGfttPZktqc2VdZ80KvCLZaPcSBZtOx2MifRuWR28sPJtUMbsFEK6cRrleUx9Xgbm3WLHa_F4Ep4Fm0PN19Ik5Dntczx0wZGzhPlL1YNMYKbv9_1IQXOw7AiUJVXRrV8cWW4O8LJCoXjCnwSRSaLshNP1d9-EmF8tqHbE.woff2
And there we are :)