Expand description
Finding sources for Google Fonts fonts
§basic usage:
use google_fonts_sources as gfsources;
// get a list of repositories:
let repo_cache = Path::new("~/where_i_want_to_checkout_fonts");
let font_repos = gfsources::discover_sources(repo_cache).unwrap();
// for each repo we find, do something with each source:
for repo in &font_repos.sources {
let sources = match repo.get_sources(repo_cache) {
Ok(sources) => sources,
Err(e) => {
eprintln!("skipping repo '{}': '{e}'", repo.repo_name());
continue;
}
};
println!("repo '{}' contains sources {sources:?}", repo.repo_name());
}Structs§
- Config
- Google fonts config file (‘config.yaml’)
- Font
Source - Information about a font source in a git repository
- Source
Set - A versioned file format representing a set of font sources
- Version
- A (major, minor) version number.
Enums§
- BadConfig
- Errors that occur while trying to load a config file
- Error
- Errors that occur while trying to find sources
- GitFail
- Things that go wrong when trying to run a git command
- Load
Repo Error - Things that go wrong when trying to clone and read a font repo
Functions§
- discover_
sources - Discover repositories containing font source files.