I need to use some google fonts on an intranet application. The clients may or may not have internet connection. Reading the license terms, it appears that its legally allo
I made a tiny PHP script to get download links from a Google Fonts CSS import URL like: https://fonts.googleapis.com/css?family=Roboto:400,700|Slabo+27px|Lato:400,300italic,900italic
You can use this tool here: http://nikoskip.me/gfonts.php
For instance, if you use the above import URL, you will get this:
There is a tool localfont.com to help you download all font variants. It as well generates the corresponding CSS for implementation. deprecated
localfont is down. Instead, as Damir suggests, you can use google-webfonts-helper
Edit: As luckyrumo pointed out, typefaces is depricated in favour of: https://github.com/fontsource/fontsource
If you're using Webpack, you might be interested in this project: https://github.com/KyleAMathews/typefaces
E.g. say you want to use Roboto font:
npm install typeface-roboto --save
Then just import it in your app's entrypoint (main js file):
import 'typeface-roboto'
You can download source fonts from https://github.com/google/fonts
After that use font-ranger
tool to split your large Unicode font into multiple subsets (e.g. latin, cyrillic). You should do the following with the tool:
Font-Ranger: https://www.npmjs.com/package/font-ranger
P.S. You can also automate this using Node.js API
There is a very simple script, written in plain Java, to download all fonts from a Google Web Font link (multiple fonts supported). It also downloads the CSS file and adapts it to local files. The user-agent can be adapted to get also other files than only WOFF2. See https://github.com/ssc-hrep3/google-font-download
The resulting files can easily be added to a build process (e.g. a webpack build like vue-webpack).
In addition to k0pernicus I would like to suggest best-served-local. It's also a bash (v4) script to enable webserver operators to download and serve Google web fonts from their own webserver. But in addition to the other bash script, it lets the user fully automate (via cron and such) the serving of up-to-date font files and css-files.