-
Notifications
You must be signed in to change notification settings - Fork 32
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
woff / woff2 #367
Comments
Probably the easiest way is to use the Google Fonts CSS API. Here is how to get Roboto Flex with its opsz and wght axes, but without the parametric axes:
This CSS links to 6 woff2 fonts, split by Unicode range. Here is the Latin font (88 kB):
You can download these fonts and serve them yourself. Copy the CSS, edit the URLs to your server and maybe edit the filenames to something handier. Use the same To make them even smaller you can drop the opsz axis if you don’t need it, or pin it to a value you like:
Again we get 6 fonts, split by Unicode range. Here is the Latin font (38 kB):
If your website is mostly Western European content, then this 38 kB font is all they will need for Roboto Flex with a 100..1000 Weight axis. Curiously, even though only the wght axis was requested, the font also includes an XOPQ axis, which most users will not need — and dropping it would make the font even smaller. I’ve asked in another place why this happens, and have not understood why it is there. Any thoughts, @davelab6 @anthrotype @sannorozco @rsheeter? |
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 :)
is there a way to get a full-featured woff/woff2 file for embedding from a local webserver instead of google?
The text was updated successfully, but these errors were encountered: