#font #source #repository #path

bin+lib google-fonts-sources

finding source repositories of Google Fonts fonts

10 releases (5 breaking)

0.7.1 Mar 4, 2025
0.6.1 Feb 21, 2025
0.5.1 Oct 28, 2024
0.1.0 Jul 3, 2024

#530 in Network programming

Download history 162/week @ 2025-01-04 96/week @ 2025-01-11 176/week @ 2025-01-18 251/week @ 2025-01-25 250/week @ 2025-02-01 477/week @ 2025-02-08 196/week @ 2025-02-15 446/week @ 2025-02-22 571/week @ 2025-03-01 419/week @ 2025-03-08 30/week @ 2025-03-15 107/week @ 2025-03-22 244/week @ 2025-03-29 170/week @ 2025-04-05 6/week @ 2025-04-12 228/week @ 2025-04-19

680 downloads per month
Used in fontc_crater

MIT/Apache

46KB
918 lines

Finding sources for Google Fonts fonts

basic usage:

// get a list of repositories:

let font_repo_cache = Path::new("~/where_i_want_to_checkout_fonts");
let font_repos = google_fonts_sources::discover_sources(font_repo_cache).unwrap();

// for each repo we find, do something with each source:

for repo in &font_repos {
    let sources = match repo.get_sources(font_repo_cache) {
        Ok(sources) => sources,
        Err(e) => {
            eprintln!("skipping repo '{}': '{e}'", repo.repo_name());
            continue;
        }
    };

    println!("repo '{}' contains sources {sources:?}", repo.repo_name());
}

google-fonts-sources

Rust utility to help find the sources of Google Fonts fonts.

This is currently bare-bones; it inspects (or checks out) the repository at github.com/google/fonts, and for each font parses its metadata file, looking for a repository.

For each repository we find, we then look for a config.yaml file in that repository's /source directory, which is present by convention on sources intended to be built by Google Fonts.

use

To use this tool from the command line, in order to generate a JSON dictionary containing information about source repositories:

cargo run -- -o repo_list.json

To use this tool from another Rust crate, see the docs.

Dependencies

~16–26MB
~508K SLoC