Files
craft-libs/crates/ps/Cargo.toml
T
FredApps a80c0f25f1 ps: add a write feature for PostScript tokens (#778, #790) (#1840)
* ps: add a write feature for PostScript tokens

Numbers, strings, matrices, path data and Flate, so apps can emit a
PostScript or EPS program without owning the token serializer. Path and
paint operators can use the Language Reference names or the one-letter
names a bound prolog defines. Container concerns stay in craft-eps.

Part of #778 and #790.

* ps: tighten write-feature number trimming and Flate bounds

- Require flate2 1.1.10 so inflate rejects an incomplete zlib stream.
- Trim trailing zeros only when the token has a decimal point, so
  places=0 keeps integer zeros at the 1e15 boundary.
- Use saturating_add when bounding inflate, so max = u64::MAX does not
  overflow.
2026-11-16 07:12:00 -05:00

30 lines
936 B
TOML

[package]
name = "craft-ps"
description = "PostScript and EPS for Craft apps: writing primitives, and an EPS interpreter that paints into PDF"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
[lints]
workspace = true
[features]
default = []
read = ["dep:craft-eps", "dep:pdf-writer", "dep:miniz_oxide", "dep:weezl", "dep:skrifa", "dep:kurbo"]
write = ["dep:kurbo", "dep:flate2"]
[dependencies]
craft-eps = { workspace = true, optional = true }
pdf-writer = { workspace = true, optional = true }
miniz_oxide = { workspace = true, optional = true }
weezl = { workspace = true, optional = true }
skrifa = { workspace = true, optional = true }
kurbo = { workspace = true, optional = true }
flate2 = { version = "1.1.10", default-features = false, features = ["rust_backend"], optional = true }
[[example]]
name = "eps2pdf"
required-features = ["read"]