**Please note: remember to put the URL in quotes, or otherwise escape any special characters.**
Google Fonts CSS URLs contain the pipe character (`|`) which will be interpreted by your shell and cause the URL passed to `degooglify.sh` to be incomplete.
## Operation
The `degooglify.sh` script takes as arguments local files and URLs (leading to `fonts.googleapis.com`). It handles multiple arguments, including mixing of URLs and files.
It then downloads the CSS files from URLs provided, and in all local and downloaded files looks for `@import` (with URL pointing to `fonts.googleapis.com`) and `src:` (with URL pointing to `fonts.gstatic.com`) statements.
For relevant `@import` statements it then:
1. downloads the CSS files, saving them locally
1. replaces the URL with the local file name generated based on the URL
1. degooglifies the downloaded file
For relevant `@import` statements it will:
1. download the CSS files, saving them locally
1. replace the URL with the local file name generated based on the URL
1. degooglify the downloaded file
For relevant `src:` statements it:
1. downloads the font files into the `fonts/` subdirectory
...
...
@@ -38,6 +41,16 @@ This is designed to give an informative file name, containing font families, sty
For font URLs, the file names of downloaded files are generated by taking the font name from `local()` stanza in the `src:` statement, and adding the extension taken from the URL.
## Dependencies
An attempt is made to keep dependencies down to as few as possible. Currently these are:
- Bash 3.x+
- either `curl` or `wget`
- GNU `sed` (or any other `sed` flavor that supports: `-i`, `-e`, `-E`)
- GNU `grep` (or any other `grep` flavor that supports extended regexen)
-`tr`
- standard system utilities (`cp`, `mkdir`)
## Bugs and feature requests
Please send bug requests and feature reports to `tech(at)occrp.org`.