Ha.nnes.dev

google-fonts-downloader

🔣

A command-line tool to download font files and CSS from Google Fonts

2025-04-16

A command-line tool to download font files and their associated CSS from Google Fonts.

Installation

Nix

If you use Nix, you can run the tool with nix run:

nix run github:hasnep/google-fonts-downloader

or add it as an input to your Nix flake:

{
  inputs = {
    nixpkgs.url = "...";
    google-fonts-downloader = {
      url = "github:Hasnep/google-fonts-downloader";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = ...
}

Build from source

You can also clone the repository and install it using cargo.

git clone https://github.com/hasnep/google-fonts-downloader.git
cd google-fonts-downloader
cargo install --path .

Usage

To download a font from a URL such as https://fonts.googleapis.com/css2?family=Roboto&display=swap, run the google-fonts-downloader tool:

google-fonts-downloader [OPTIONS] <URL>...