mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
The nine OFL faces in `assets/fonts` are compiled into every build of vectorcraft-text: 3.4 MB of the binary, about 1.6 MB of a gzipped wasm. An embedder that loads every font at run time with `FontDb::add_font` (a web app serving its own font catalogue, say) ships them twice and can't turn them off. - vectorcraft-text: `bundled-fonts`, a default feature, holds the `include_bytes!` list. Off, a database starts without them (craft-fonts and system fonts are unaffected) and text has no glyphs until a font is added, as when the bundled fonts fail to parse. - vectorcraft-engine: a `bundled-fonts` default feature forwards to it, so the apps and any embedder using the engine keep the fonts unless they build it with `default-features = false`. - The workspace declares vectorcraft-text without default features, so no library crate turns the fonts back on. The tests of cad, metafile and tools, which lay type out, ask for the feature in their dev-dependencies; the other crates' tests get it through testkit. `cargo test --workspace` builds with the fonts, as before. A new integration test, `without_bundled_fonts`, covers the configuration without them (`cargo test -p vectorcraft-text --no-default-features --test without_bundled_fonts`): the database starts without them, text in no font lays out with no glyphs, and a font added later is used and is the fallback for families the database lacks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
128 lines
5.8 KiB
TOML
128 lines
5.8 KiB
TOML
[workspace]
|
||
resolver = "3"
|
||
members = ["crates/*", "apps/*", "xtask"]
|
||
default-members = ["crates/*", "apps/vectorcraft", "apps/vectorcraft-cli", "xtask"]
|
||
|
||
[workspace.package]
|
||
version = "0.11.0"
|
||
edition = "2024"
|
||
license = "MIT OR Apache-2.0"
|
||
rust-version = "1.95"
|
||
repository = "https://github.com/storytold/vectorcraft"
|
||
|
||
[workspace.dependencies]
|
||
craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d", default-features = false, features = ["interpret", "write"] }
|
||
craft-print = { git = "https://github.com/storytold/craft-libs", rev = "d991bf6792f8ade99c51358bf3c1d902c8cd96b5" }
|
||
craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] }
|
||
# internal
|
||
vectorcraft-geom = { path = "crates/geom" }
|
||
vectorcraft-color = { path = "crates/color" }
|
||
vectorcraft-doc = { path = "crates/doc" }
|
||
vectorcraft-pathops = { path = "crates/pathops" }
|
||
vectorcraft-brush = { path = "crates/brush" }
|
||
vectorcraft-trace = { path = "crates/trace" }
|
||
# Without its default `bundled-fonts`: the engine turns them on (its own default feature), so a
|
||
# library crate never forces them on an embedder that supplies its fonts at run time.
|
||
vectorcraft-text = { path = "crates/text", default-features = false }
|
||
vectorcraft-effects = { path = "crates/effects" }
|
||
vectorcraft-three-d = { path = "crates/three-d" }
|
||
vectorcraft-render = { path = "crates/render" }
|
||
vectorcraft-svg = { path = "crates/svg" }
|
||
vectorcraft-pdf = { path = "crates/pdf" }
|
||
vectorcraft-format = { path = "crates/format" }
|
||
vectorcraft-tools = { path = "crates/tools" }
|
||
vectorcraft-engine = { path = "crates/engine" }
|
||
vectorcraft-ui-egui = { path = "crates/ui-egui" }
|
||
vectorcraft-mcp = { path = "crates/mcp" }
|
||
vectorcraft-testkit = { path = "crates/testkit" }
|
||
vectorcraft-cad = { path = "crates/cad" }
|
||
vectorcraft-eps = { path = "crates/eps" }
|
||
vectorcraft-metafile = { path = "crates/metafile" }
|
||
vectorcraft-plugins = { path = "crates/plugins" }
|
||
vectorcraft-affinity = { path = "crates/affinity" }
|
||
vectorcraft-scriptcheck = { path = "crates/scriptcheck" }
|
||
|
||
# foundation
|
||
kurbo = { version = "0.13", features = ["serde"] }
|
||
peniko = "0.6"
|
||
thiserror = "2"
|
||
serde = { version = "1", features = ["derive", "rc"] }
|
||
serde_json = { version = "1", features = ["float_roundtrip"] }
|
||
log = "0.4"
|
||
proptest = "1"
|
||
crc32fast = "1.5"
|
||
# tests: a TCP port bound without listening (connections to it are refused)
|
||
socket2 = "0.6"
|
||
# Sandboxed WebAssembly plug-ins: a pure-Rust interpreter (MIT OR Apache-2.0) that builds for wasm32
|
||
# too. Without `wat` (text parsing is test-only) and memory64; `validate` keeps full module
|
||
# validation on; the portable dispatcher can't overflow the host stack on long-running modules.
|
||
wasmi = { version = "2.0.0", default-features = false, features = ["std", "validate", "stable", "portable-dispatch"] }
|
||
# Tests: WebAssembly text -> binary for the plug-in fixtures (Apache-2.0 WITH LLVM-exception).
|
||
wat = "1.228"
|
||
|
||
# rendering / formats
|
||
# Without `text` (glyph runs, through glifo and a second skrifa): the renderer draws the outlines
|
||
# vectorcraft-text gives it. The other default features stay.
|
||
vello_cpu = { version = "0.2", default-features = false, features = ["std", "png", "u8_pipeline", "f32_pipeline"] }
|
||
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp", "gif", "tiff", "bmp"] }
|
||
# Without `text` and the system fonts (fontdb, harfrust and skrifa, at other versions than ours):
|
||
# SVG import reads `<text>` from the XML itself and never gives usvg a font. A test of the SVG
|
||
# crate turns `text` on.
|
||
usvg = { version = "0.48", default-features = false, features = ["svgz"] }
|
||
# Without `simple-text` (its text shaping, the only user of rustybuzz and ttf-parser, which are
|
||
# unmaintained, #1730): the PDF writer places glyphs itself. A test of the PDF crate turns it on.
|
||
krilla = { version = "0.8", default-features = false, features = ["raster-images"] }
|
||
skrifa = "0.47"
|
||
harfrust = "0.13"
|
||
linesweeper = "0.5"
|
||
flate2 = { version = "1", default-features = false, features = ["rust_backend"] }
|
||
rustix = { version = "1.1", default-features = false }
|
||
# Zstandard decoder (pure Rust, builds for wasm32 too): the editing copy an EPS carries of its art.
|
||
ruzstd = { version = "0.9.1", default-features = false, features = ["std"] }
|
||
jpeg-encoder = { version = "0.6", default-features = false, features = ["std"] }
|
||
gif = { version = "0.14", default-features = false, features = ["std", "raii_no_panic"] }
|
||
# CMYK image samples (vectorcraft-doc's cmyk module): the image crate's own TIFF and JPEG
|
||
# decoders, read directly (the image crate converts CMYK to RGB).
|
||
tiff = "0.11"
|
||
zune-jpeg = "0.5"
|
||
|
||
# ui
|
||
egui = "0.36"
|
||
egui_extras = { version = "0.36", default-features = false, features = ["svg"] }
|
||
eframe = { version = "0.36", default-features = false }
|
||
egui_kittest = "0.36"
|
||
rfd = "0.17"
|
||
arboard = { version = "3.6", default-features = false }
|
||
clipboard-win = "5.4"
|
||
webbrowser = "1"
|
||
|
||
[workspace.lints.rust]
|
||
unsafe_code = "deny"
|
||
|
||
[workspace.lints.clippy]
|
||
dbg_macro = "warn"
|
||
# VectorCraft never crashes: shipped code returns `Result`/`Option` instead of panicking (see
|
||
# AGENTS.md › Robustness). Tests may unwrap (clippy.toml).
|
||
unwrap_used = "deny"
|
||
expect_used = "deny"
|
||
panic = "deny"
|
||
todo = "deny"
|
||
unimplemented = "deny"
|
||
unreachable = "deny"
|
||
|
||
[profile.dev.package."*"]
|
||
opt-level = 2
|
||
|
||
[profile.dev]
|
||
opt-level = 1
|
||
|
||
[profile.release]
|
||
lto = "thin"
|
||
codegen-units = 1
|
||
|
||
[patch.crates-io]
|
||
hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d" }
|
||
hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d" }
|
||
hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d" }
|
||
krilla = { git = "https://github.com/storytold/craft-libs", rev = "ca50d63b773c99f96e75c77ce5a1d21e7c9cda0d" }
|