Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Building blocks for shape reuse #102

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ temp-env = "0.3.3"
[workspace]

members = [
"shape-brokkr",
"fontdrasil",
"fontbe",
"fontir",
Expand Down
26 changes: 26 additions & 0 deletions shape-brokkr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "shape-brokkr"
version = "0.0.1"
edition = "2021"
license = "MIT/Apache-2.0"
description = "A simple representation of a path, meant for use in fonts. Tools to find reusable parts in sets of shapes."
repository = "https://github.com/googlefonts/fontmake-rs"
readme = "README.md"
categories = ["text-processing", "parsing", "graphics"]

[features]

[dependencies]
thiserror = "1.0.37"

kurbo = "0.9.0"
ordered-float = "3.4.0"
serde = {version = "1.0", features = ["derive"] }

log = "0.4"
env_logger = "0.9.0"

[dev-dependencies]
diff = "0.1.12"
ansi_term = "0.12.1"
tempfile = "3.3.0"
10 changes: 10 additions & 0 deletions shape-brokkr/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use kurbo::BezPath;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
#[error("{1} {0:?}")]
InvalidPath(BezPath, String),
#[error("No curve contains significant movement")]
NoSignificantActivity,
}
7 changes: 7 additions & 0 deletions shape-brokkr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Library to aid in identifying reusable shapes.
//!
//! Derived from <https://github.com/googlefonts/nanoemoji>'s implementation
//! of shape reuse.
mod error;
pub use error::Error;
pub mod reuse;
Loading