A command line tool to dump the CSS and different formats of fonts for Google Fonts, so you can serve them on your local servers.
Usage
$ fontdump -h
fontdump heps you dump google web fonts.
__ _ _
/ _| | | | |
| |_ ___ _ __ | |_ __| |_ _ _ __ ___ _ __
| _/ _ \| '_ \| __/ _` | | | | '_ ` _ \| '_ \
| || (_) | | | | || (_| | |_| | | | | | | |_) |
|_| \___/|_| |_|\__\__,_|\__,_|_| |_| |_| .__/
| |
|_|
Usage:
fontdump <google-fonts-url> [--font-dir-path=<path>]
fontdump (-h | --help)
Options:
-h --help Show this screen.
--font-dir-path=<path> Path to the font dir(ends with /).
e.g('staic/fonts/', 'http://cdn/.../fonts/')
--output=<dir> The directory saves the dumped css and font files
FAQs
Question: What’s wrong with Google Fonts? Why do I want to serve the fonts on my own server?
Answer: Google Fonts is Great. You shall use it normally. But for users in some countries, Google Fonts is very slow and sometimes even inaccessible. Serving your own fonts is the only choice for them. Besides, some developers may wish to have more control over web fonts. They might want to embed fonts as base64 strings into the css to bypass crazy firewalls. They might to store the fonts as jsons to the localstorage to speed up page loading.
Question: Why do I need to install a software to download these fonts? Can’t I just open the Chrome developer tools and download the css and fonts manually?
Answer: Making css font rules compatible with different browsers is not easy. Thus Google detects the browser’s User Agent string and serve the css that is only compatible with the given browser.
As a web developer/designer, it is very likely that you are using a modern browser, so the css you get from Google only works in modern browsers. To improve the user experience for old browser users , we need to download the 4 differnet formats of fonts and merge the css rules into a single stylesheet. A tool can simplify the process.
Question: What would the merged css look like?
Answer:
like this:
@font-face {
font-family: 'WebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: local('WebFont'),
url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
Reference:
Metadata
Release files for fontdump 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| fontdump-1.3.0.tar.gz | 6.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fontdump-1.3.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 15.1 kB
Release files / fontdump-1.3.0.tar.gz
| Download URL | fontdump-1.3.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
568f196d24e7b39256739baa4ef3064fab2b843c41cd4fa40ee7e463c624c232
|
|
BLAKE2b-256 checksum How to use checksums |
eff50d370a3b4053da0cbf61d417cbe4576ecfe19d4c5677ca78028570de347a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / fontdump-1.3.0-py2.py3-none-any.whl
| Download URL | fontdump-1.3.0-py2.py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
39431cc485eadf76085a69c3272bcef943f7916737a8586aa941b7f4d14c04ff
|
|
BLAKE2b-256 checksum How to use checksums |
0fc97a10f41284a9ab243e4b6170f8e7164c8b812f18fa52952ba20d381ada8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for fontdump 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.