Skip to content
Python tools to download fonts from FontSquirrel
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
destino.json
ez_setup.py
font-dl.py
fontsquirrel.py
fontsquirrel.pyc
googledata.json
googlefont.py
setup.py
test.py
test2.py

README.md

fontsquirrel_dl

This is a Python 3.x library which provides an easy access to FontSquirrel API.

Some cache is stored to get data faster.

##Documentation This library allows to:

  1. Download all fonts freely available on Font Squirrel
  2. Download a family (using url_name)
  3. Return data from Font Squirrel on a similar way on Google Fonts

#1: Download all familes on FontSquirrel

Font Squirrel's API allows access to free and open fonts. All fonts which needs to go to another site are not available here. The function is contained on FontSquirrel class. It takes one argument: the folder where you want to download and extract the fonts.

import FontSquirrel
FontSquirrel.get_family("raleway",'font/')

#2: Download one family from FontSquirrel

Once you know the url_name for the font you want, you can use the get_family() function. Takes one argument: the folder where you have to download.

import FontSquirrel
FontSquirrel.get_all_families("Fonts/")

#3: Get Json data like Google Font's API

You can get the data from FontSquirrel on a similar way that Google provides with his Web Fonts API. It does not have the same atributes: some of them are not available.

{ 'kind': 'fontsquirrel',
  'family': #family_name
  'family_url': #family_urlname
  'category': #Classification
  "variants" : [ "regular" .. "thin" ]
  "files" : {
     "regular" : "Family-variant.otf",
     "thin" : "Family-variant2.otf",
  }

The files are placed into the zip associated to the family.

##API

Download one family from FontSquirrel

Once you know the url_name for the font you want, you can use the get_family() function. Takes one argument: the folder where you have to download.

import FontSquirrel
FontSquirrel.get_family("raleway",'font/')
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.