Skip to main content

typg_core/
lib.rs

1/// typg-core: font search engine.
2///
3/// Discovers font files on the filesystem, extracts OpenType metadata,
4/// and evaluates queries against that metadata. Parallel via rayon.
5///
6/// ## Modules
7///
8/// - [`discovery`]: Filesystem traversal to find font files
9/// - [`search`]: Metadata extraction and query evaluation
10/// - [`query`]: Query construction and filter logic
11/// - [`output`]: Result formatting (JSON, NDJSON)
12/// - [`tags`]: OpenType tag parsing utilities
13/// - [`index`]: LMDB-backed index (behind `hpindex` feature)
14///
15/// ## Example
16///
17/// ```rust,no_run
18/// use std::path::PathBuf;
19/// use typg_core::query::Query;
20/// use typg_core::search::{search, SearchOptions};
21/// use typg_core::tags::tag4;
22///
23/// let query = Query::new()
24///     .with_scripts(vec![tag4("arab").unwrap()])
25///     .with_axes(vec![tag4("wght").unwrap()])
26///     .require_variable(true);
27///
28/// let dirs = vec![PathBuf::from("/Library/Fonts")];
29/// let results = search(&dirs, &query, &SearchOptions::default())?;
30///
31/// for font in &results {
32///     println!("{}", font.source.path_with_index());
33/// }
34/// # Ok::<(), Box<dyn std::error::Error>>(())
35/// ```
36///
37/// Made by FontLab https://www.fontlab.com/
38pub mod discovery;
39#[cfg(feature = "hpindex")]
40pub mod index;
41pub mod output;
42pub mod query;
43pub mod search;
44pub mod tags;