Code Monkey home page Code Monkey logo

webfont-downloader's Introduction

Webfont Downloader

Easily download Google Webfonts as a zip file. Useful for offline development. Recently ported from Node to Go.

Usage

  1. Given the Google Webfonts CSS file:

    https://fonts.googleapis.com/css?family=Open+Sans

  2. Just change googleapis in the URL to jpillora:

    https://fonts.jpillora.com/css?family=Open+Sans

  3. It should begin to download an OpenSans.zip file

  4. Use it with:

    <link rel="stylesheet" href="./path/to/my/local/css/OpenSans/OpenSans.css">

Examples

API

/<type>/css?family=<font:styles>

Creates a zip archive of font family provided, including each of the styles listed.

The type param is optional and can be one of ttf, woff (default),woff2, eot or detect (chooses the best type for your browser).

CLI Usage

wget --content-disposition 'https://fonts.jpillora.com/css?family=<your-font-here>'
# or
curl 'https://fonts.jpillora.com/css?family=<your-font-here>' > /tmp/font.zip

https://fonts.jpillora.com was deployed using the button below

Deploy your own

Deploy

Local Usage

$ # install go
$ go get github.com/jpillora/webfont-downloader
$ webfont-downloader
Listening on 3000...

FAQ

Google already has this service available

It does, though it provides you with only the .ttf files. This also service downloads .woff and .eof files and creates a local version of the one-line include CSS file.

MIT License

Copyright ยฉ 2014 Jaime Pillora <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

webfont-downloader's People

Contributors

jpillora avatar perk11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

periloso

webfont-downloader's Issues

nice work!

Nice work, can't wait to use this.

PS you might want to add this github repo to your package.json, it will make it easier for people to find/contribute to the project.

ERROR 400: Bad Request

Cannot download Noto Sans font.

wget http://webfonts.jpillora.com/css?family=Noto+Sans
--2014-09-19 09:48:05--  http://webfonts.jpillora.com/css?family=Noto+Sans
Resolving webfonts.jpillora.com (webfonts.jpillora.com)... 50.17.212.209
Connecting to webfonts.jpillora.com (webfonts.jpillora.com)|50.17.212.209|:80... connected.
HTTP request sent, awaiting response... 400 Bad Request
2014-09-19 09:48:05 ERROR 400: Bad Request.

Invalid font formats

In some browsers, it reports failing to decode, however they still display. I think the downloads aren't pulling the correct formats. Haven't looked deeply into this yet.

Empty fonts in zip file

Download seems OK, but font files are empty except css file ๐Ÿ˜Ÿ

(python-env)sardor@localhost:~/tmp$ ls -lFXh
total 4.0K
-rw-r--r-- 1 sardor sardor 251 Sep 19 02:20 NotoSans.css
-rw-r--r-- 1 sardor sardor   0 Sep 19 02:20 NotoSans-0.eot
-rw-r--r-- 1 sardor sardor   0 Sep 19 02:20 NotoSans-1.eot
-rw-r--r-- 1 sardor sardor   0 Sep 19 02:20 NotoSans-2.woff

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.