Commit 08731128 authored by Michał 'rysiek' Woźniak's avatar Michał 'rysiek' Woźniak
Browse files more or less complete

parent 93f2cef3
# Fonts Degooglifier
A script to de-googlify CSS files, downloading relevant fonts in the process. Because privacy matters and self-hosting is a thing.
## Usage
./ [ | file.css ]
## Operation
The `` script takes as arguments local files and URLs (leading to ``). 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 ``) and `src:` (with URL pointing to ``) 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 `src:` statements it:
1. downloads the font files into the `fonts/` subdirectory
1. replaces the URLs with downloaded font files' locations
Original files are never modified. Instead, copies are created with `.degooglified` added to the name right before the `.css` extension.
## Filenames of downloaded resources
For CSS URLs, the file names of downloaded files are generated by:
1. dropping the `` part
1. replacing all occurences of `&` and `&` with `__`
1. replacing all occurences of `|` with `_`
1. replacing all occurences of any of `:+,=` with `-`
1. adding `.degooglified` before the final `.css`
This is designed to give an informative file name, containing font families, styles, and information on scripts included, based on the information available in the original CSS URL.
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.
## Bugs and feature requests
Please send bug requests and feature reports to `tech(at)`.
## License
GNU Affero General Public License, version 3.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment