https://github.com/drwpow/google-fonts-extractor
Pull Google Font files and CSS through the API
https://github.com/drwpow/google-fonts-extractor
Last synced: over 1 year ago
JSON representation
Pull Google Font files and CSS through the API
- Host: GitHub
- URL: https://github.com/drwpow/google-fonts-extractor
- Owner: drwpow
- License: mit
- Created: 2022-08-03T21:30:59.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-08-03T21:39:01.000Z (almost 4 years ago)
- Last Synced: 2025-02-10T04:17:32.126Z (over 1 year ago)
- Language: TypeScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Google Fonts Extractor
Deno script to extract a copy of a Google Font locally.
To use:
1. Clone this repo locally (`git clone git@github.com:drwpow/google-fonts-extractor.git`)
1. Select your fonts from [fonts.google.com](https://fonts.google.com). You can select all your faces/options as you would normally.
1. In the **Use on the web** sidepanel, copy the URL inside `` (just the HREF part)
1. Paste it to the script via the `--url` flag:
```
deno run --allow-net --allow-write ./extract.ts --url="https://fonts.googleapis.com/css2?family=Roboto:…"
```
This will download everything to the `./downloads/` folder in this directory. You’ll also find a `./downloads/fonts.css` file generated for you with links to everything.
## Extracting other fonts
This could be used to extract fonts from any CSS file, really, but that hasn’t been tested.
## Why not use [google webfonts helper](https://github.com/majodev/google-webfonts-helper)?
That doesn’t preserve subsetting as carefully as this does. The files downloaded from that tool end up more bloated than usual.