Skip to main content

Google fonts installer utility.

Project description

Installs selected fonts from the Google fonts directory by selectively cloning the Git repository at github.com/google/fonts and creating symlinks in your ~/.fonts directory.

Quickstart:

$ pipsi install googlefonts_installer
$ mkdir -p ~/googlefonts
$ cd ~/googlefonts
# Add list of font paths from git repo to:
$ vim googlefonts.conf
$ googlefonts-installer

To update fonts from Git, install new fonts or remove fonts, just (optionally) change googlefonts.conf and re-run googlefonts-installer.

Requirements

To use this, you’ll need

  • Python 3.3+ to run this script,

  • a recent version of Git supporting sparse checkouts,

  • a Linux-based system that uses the ~/.fonts directory.

Usage / How it works

  1. Create a directory for the Git clone:

    $ mkdir -p ~/Fonts/googlefonts/
    $ cd ~/Fonts/googlefonts/
  2. Install the googlefonts-installer package from PyPi. A good way to do this is via pipsi:

    $ pipsi install googlefonts_installer

    You now have the googlefonts-installer command available.

  3. List the fonts to install, or more precicely the sub-paths of the Google fonts Git repository to clone, in a googlefonts.conf configuration file, e.g.:

    ufl/ubuntu
    ofl/firamono
    ofl/firasans

    For example, to install Ubuntu Regular, use the directory part ufl/ubuntu/ of the file ufl/ubuntu/Ubuntu-Regular.ttf in the repository.

  4. Run googlefonts-installer. This …

    • If not yet done, inits a Git repository with sparse-checkout (only clone the defined paths) and adds the Google fonts Git repository as a remote.

    • Pulls the latest changes (shallow history to save space).

    • Creates symlinks for each font directory to ~/.fonts.

    • Removes broken symlinks from ~/.fonts for uninstalled (removed from googlefonts.conf) fonts.

Defaults

The googlefonts-installer command defaults to:

  • reading config from googlefonts.conf in the current working directory,

  • cloning into the current working directory and

  • symlinking to ~/.fonts.

Use the --config, --work-dir and --fonts-dir arguments to change this behaviour.

Hint

To find the sub-paths of the fonts you’d like to install, go to https://github.com/google/fonts, hit t and start typing a font’s name. Github will list all matching file names.

Changelog

0.3.1 - unreleased

  • Fix broken source and wheel distributions. Now actually installable.

0.3.0 - 2016-03-10

  • Clean up broken symlinks from ~/.fonts after uninstalling a font (removed from googlefonts.conf).

  • Improve documentation.

0.2.0 - 2016-03-09

  • Packaging fix.

0.1.0 - 2016-03-09

  • Initial implementation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

googlefonts_installer-0.3.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

googlefonts_installer-0.3.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file googlefonts_installer-0.3.1.tar.gz.

File metadata

File hashes

Hashes for googlefonts_installer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 73991608123a0e32baab6d981e26434763755138942ed5ff4133377fb1d8f1c3
MD5 4e0f18cb6df0d73ba67c0ae7e2af4bc2
BLAKE2b-256 6065c1edf87f3f9a3077660936da75a68500db83f691f2a5cc7860371271076b

See more details on using hashes here.

File details

Details for the file googlefonts_installer-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for googlefonts_installer-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e8c256cbe662728041a707abd96a044f6c71a1bef2888386f1229ad8f4db0a83
MD5 5c8f4667c06cda3c0ce3be251a6a1931
BLAKE2b-256 568827ea42a78c4772abfdeb78c1848cbef51df12b024ee4b5b5525c5823d00f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page