Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use woff2 format for RobotoFlex font #4

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Conversation

davidbgk
Copy link
Contributor

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 :)

Fixes clagnut#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 :)
@davidbgk davidbgk changed the title Use woff2 format for RobotFlex font Use woff2 format for RobotoFlex font Oct 18, 2024
@clagnut clagnut merged commit 121eb47 into clagnut:main Oct 18, 2024
@clagnut
Copy link
Owner

clagnut commented Oct 18, 2024

Thanks David! I kind of assumed you had the WOFF2 to hand already - thanks so much for jumping through the hoops. Had I known I would have pointed you to a tutorial I wrote (mostly for myself) and how to do this: https://clagnut.com/blog/2418/

@davidbgk
Copy link
Contributor Author

Thanks for the link @clagnut I feel bad describing my journey now, at least I learned something! 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.79Mo RobotoFlex.ttf font for the demo page?
2 participants