Skip to content

Commit

Permalink
Simplify the features
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov committed Oct 17, 2023
1 parent 309eb22 commit 40cebf5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions founder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "founder"
version = "0.9.0"
version = "0.10.0"
edition = "2021"
license = "Apache-2.0/MIT"
authors = ["Ivan Ukhov <[email protected]>"]
Expand All @@ -11,10 +11,8 @@ repository = "https://github.com/bodoni/workbench/tree/main/founder"
exclude = ["tests/fixtures/*"]

[features]
bin = ["arguments"]
rasterize = ["bin", "resvg"]
vectorize = ["bin", "svg"]
name = ["bin"]
default = ["bin"]
bin = ["arguments", "colored", "resvg"]

[[bin]]
name = "founder"
Expand All @@ -23,23 +21,23 @@ path = "src/bin/main.rs"
[[bin]]
name = "founder-rasterize"
path = "src/bin/rasterize.rs"
required-features = ["rasterize"]
required-features = ["bin"]

[[bin]]
name = "founder-vectorize"
path = "src/bin/vectorize.rs"
required-features = ["vectorize"]
required-features = ["bin"]

[[bin]]
name = "founder-name"
path = "src/bin/name.rs"
required-features = ["name"]
required-features = ["bin"]

[dependencies]
colored = "2"
folder = "0.5"
font = "0.24"
svg = "0.13"

arguments = { version = "0.7", optional = true }
colored = { version = "2", optional = true }
resvg = { version = "0.28", default-features = false, optional = true }
svg = { version = "0.13", optional = true }
14 changes: 7 additions & 7 deletions founder/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test-name:
# https://github.com/google/fonts/issues/5553
# https://github.com/google/fonts/issues/5724
# https://github.com/google/fonts/issues/5805
cargo run --bin founder-name --features name -- \
cargo run --bin founder-name -- \
--path ../tests/fixtures/fonts \
--exclude google-fonts/ofl/bungeecolor \
--exclude google-fonts/ofl/bungeespice \
Expand All @@ -37,7 +37,7 @@ test-name:
.PHONY: test-name-selected
test: test-name-selected
test-name-selected:
cargo run --bin founder-name --features name -- \
cargo run --bin founder-name -- \
--path tests/fixtures/fonts
rm -rf tests/fixtures/name/*
mv tests/fixtures/fonts/*.txt tests/fixtures/name
Expand All @@ -46,7 +46,7 @@ test-name-selected:
.PHONY: test-rasterize-selected
test: test-rasterize-selected
test-rasterize-selected:
cargo run --bin founder-rasterize --features rasterize -- \
cargo run --bin founder-rasterize -- \
--path tests/fixtures/vectorize \
--exclude AdobeBlank

Expand All @@ -56,7 +56,7 @@ test-vectorize:
# https://github.com/google/fonts/issues/5551
# https://github.com/google/fonts/issues/5553
# https://github.com/google/fonts/issues/5724
cargo run --bin founder-vectorize --features vectorize -- \
cargo run --bin founder-vectorize -- \
--path ../tests/fixtures/fonts \
--exclude google-fonts/ofl/bungeecolor \
--exclude google-fonts/ofl/bungeespice \
Expand All @@ -82,7 +82,7 @@ test: test-vectorize-selected-free
test-vectorize-selected-free:
rm -rf tests/fixtures/vectorize/free
cp -R tests/fixtures/fonts tests/fixtures/vectorize/free
cargo run --bin founder-vectorize --features vectorize -- --path tests/fixtures/vectorize/free --mode free
cargo run --bin founder-vectorize -- --path tests/fixtures/vectorize/free --mode free
rm tests/fixtures/vectorize/free/*.{otf,ttf}
[ "$$(git diff tests/fixtures/vectorize/free | wc -l | xargs)" = 0 ] || exit 1

Expand All @@ -91,7 +91,7 @@ test: test-vectorize-selected-local
test-vectorize-selected-local:
rm -rf tests/fixtures/vectorize/local
cp -R tests/fixtures/fonts tests/fixtures/vectorize/local
cargo run --bin founder-vectorize --features vectorize -- --path tests/fixtures/vectorize/local --mode local
cargo run --bin founder-vectorize -- --path tests/fixtures/vectorize/local --mode local
rm tests/fixtures/vectorize/local/*.{otf,ttf}
[ "$$(git diff tests/fixtures/vectorize/local | wc -l | xargs)" = 0 ] || exit 1

Expand All @@ -100,6 +100,6 @@ test: test-vectorize-selected-global
test-vectorize-selected-global:
rm -rf tests/fixtures/vectorize/global
cp -R tests/fixtures/fonts tests/fixtures/vectorize/global
cargo run --bin founder-vectorize --features vectorize -- --path tests/fixtures/vectorize/global --mode global
cargo run --bin founder-vectorize -- --path tests/fixtures/vectorize/global --mode global
rm tests/fixtures/vectorize/global/*.{otf,ttf}
[ "$$(git diff tests/fixtures/vectorize/global | wc -l | xargs)" = 0 ] || exit 1
4 changes: 0 additions & 4 deletions founder/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//! A font toolbox.
#[cfg(feature = "vectorize")]
pub extern crate svg;

#[cfg(feature = "vectorize")]
pub mod drawing;

0 comments on commit 40cebf5

Please sign in to comment.