Files
craft-libs/crates/ps/src/lib.rs
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

14 lines
559 B
Rust

//! PostScript and EPS for the Craft apps.
//!
//! - [`write`] (feature `write`): numbers, strings, matrices, path data and Flate, so an app can
//! emit a PostScript or EPS program.
//! - [`read`] (feature `read`): runs an EPS and gives what it paints as a one-page vector PDF,
//! for apps that place EPS files as graphics.
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
#![forbid(unsafe_code)]
#[cfg(feature = "read")]
pub mod read;
#[cfg(feature = "write")]
pub mod write;