https://github.com/robertoprevato/cssfontsharvester
Simple solution to bulk download fonts from css source code
https://github.com/robertoprevato/cssfontsharvester
Last synced: 6 months ago
JSON representation
Simple solution to bulk download fonts from css source code
- Host: GitHub
- URL: https://github.com/robertoprevato/cssfontsharvester
- Owner: RobertoPrevato
- License: mit
- Created: 2018-04-02T10:36:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-02T10:58:28.000Z (over 7 years ago)
- Last Synced: 2024-11-24T20:46:29.470Z (11 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Bulk downloader for font files inside CSS source code
Have you ever desired to bulk download font files from css source, to not rely on third parties CDN networks? I did, sometimes. Sometimes I worked for clients that didn't accept to have certain static files downloaded from third party servers; and sometimes while developing a new application, with developer console open and _"Disable Cache"_ option on, I saw that downloading all the time the fonts from remote servers could be slow. In other words, I desired to download fonts as static files and have my development server serve them.For example, having this CSS source from CDN: __[https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons](https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons)__, in some situations I desire to download the source fonts, to deploy them in my applications. This simple console application does it; it also generates CSS files with URLs pointing to absolute HTTP paths with a relative path: `/fonts/file_name`. Downloaded fonts can then be placed in a folder: `fonts` in the application root folder.
```bash
python fetchfonts.py -s roboto-material-icons.css
```### Requirements
* Python >= 3.5### How to use
```bash
python -m venv env# activate environment (Linux)
source env/bin/activate# activate environment (Windows)
env\Scripts\activate# install dependencies
pip install -r requirements.txt# download fonts, having a css file locally:
python fetchfonts.py -s roboto-material-icons.css
```