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
$ vim googlefonts.conf
$ googlefonts-installer

Requirements

To use this, you’ll need

  • Python 3.4+ to run this script,

  • a recent version of Git supporting sparse checkouts,

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

Usage

  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:

    ufl/ubuntu
    ofl/firamono
    ofl/firasans
  4. Run googlefonts-installer. This …

    • Sparse-clones (only the defined paths) the Google fonts Git repository (if not yet done).

    • Pulls the latest changes.

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

Defaults

The googlefonts-installer command defaults to cloning into the current working directory and symlinking to ~/.fonts, the googlefonts.conf configuration file is assumed to be in the current working directory as well.

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

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. For example, to install Ubuntu Regular, use the directory part of the file ufl/ubuntu/Ubuntu-Regular.ttf listed by Github.

Changelog

0.1.0 - unreleased

  • Initial implementation.

Project details


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