From 7b895f0bf0a31dc4d1b48565e7d3ea9eed6e4efc Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 06:23:46 -0500 Subject: [PATCH 1/5] refactor(eps): delegate PostScript write primitives to craft-ps --- Cargo.lock | 10 +++ Cargo.toml | 1 + crates/eps/Cargo.toml | 1 + crates/eps/src/ps.rs | 184 +++++++----------------------------------- 4 files changed, 42 insertions(+), 154 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81946466b5..34bcd903ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1134,6 +1134,15 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "craft-ps" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=9c8839ce57190653d28bcea1fe2f217ff970b11b#9c8839ce57190653d28bcea1fe2f217ff970b11b" +dependencies = [ + "flate2", + "kurbo 0.13.1", +] + [[package]] name = "craft-psd" version = "0.1.0" @@ -6722,6 +6731,7 @@ version = "0.24.1" dependencies = [ "craft-eps", "craft-pdf", + "craft-ps", "encoding_rs", "fax", "flate2", diff --git a/Cargo.toml b/Cargo.toml index 64f85eb450..858fa5ab71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "9c8839ce57190653d28bcea1fe2f217ff970b11b", default-features = false, features = ["write"] } craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "e98299546f5c5c3c22388d16507f8b5e61a5f280", features = ["egui"] } # internal diff --git a/crates/eps/Cargo.toml b/crates/eps/Cargo.toml index bd173588aa..e51500808c 100644 --- a/crates/eps/Cargo.toml +++ b/crates/eps/Cargo.toml @@ -10,6 +10,7 @@ workspace = true [dependencies] craft-eps = { workspace = true } +craft-ps = { workspace = true } vectorcraft-geom = { workspace = true } vectorcraft-color = { workspace = true } vectorcraft-doc = { workspace = true } diff --git a/crates/eps/src/ps.rs b/crates/eps/src/ps.rs index 2a10b8a86c..f43b08fcb7 100644 --- a/crates/eps/src/ps.rs +++ b/crates/eps/src/ps.rs @@ -1,11 +1,9 @@ //! PostScript writing primitives: numbers, strings, paths, the prolog's short operator names, and //! the data encodings images and embedded data use (ASCII85, run-length, Flate). -use std::fmt::Write; -use std::io::{Read, Write as _}; +use vectorcraft_geom::{BezPath, FillRule}; -use kurbo::PathEl; -use vectorcraft_geom::{Affine, BezPath, FillRule}; +pub(crate) use craft_ps::write::{bytes, deflate, inflate, matrix, num, push_num, push_num_places, push_nums, string, written}; /// The procedures the page uses, in `VCdict`. pub(crate) const PROLOG: &str = "/VCdict 64 dict def @@ -21,142 +19,9 @@ VCdict begin end "; -/// `v` as PostScript writes it: at most four decimals, no trailing zeros (0 when not finite). -pub(crate) fn num(v: f64) -> String { - let mut s = String::new(); - push_num(&mut s, v); - s -} - -/// Append [`num`]`(v)` to `s`. -pub(crate) fn push_num(s: &mut String, v: f64) { - push_num_places(s, v, 4); -} - -/// The value [`num`]`(v)` stands for, as a reader parses it back. -pub(crate) fn written(v: f64) -> f64 { - num(v).parse().unwrap_or(0.0) -} - -/// Append `v` to `s` with at most `places` decimals (up to 9), no trailing zeros (0 when not -/// finite). -pub(crate) fn push_num_places(s: &mut String, v: f64, places: u32) { - let places = places.min(9); - let scale = 10f64.powi(places as i32); - // Past where the scaling overflows, values have no fractional digits to round. - let v = if !v.is_finite() { - 0.0 - } else if (v * scale).is_finite() { - (v * scale).round() / scale - } else { - v - }; - if v == v.trunc() && v.abs() < 1e15 { - let _ = write!(s, "{}", v as i64); - return; - } - let start = s.len(); - let _ = write!(s, "{v:.*}", places as usize); - let keep = s[start..].trim_end_matches('0').trim_end_matches('.').len(); - s.truncate(start + keep); -} - -/// `vs` as numbers separated by spaces, then a space. -pub(crate) fn push_nums(s: &mut String, vs: &[f64]) { - for v in vs { - push_num(s, *v); - s.push(' '); - } -} - -/// `text` as a PostScript string: `(` `)` `\` escaped, anything outside printable ASCII as octal -/// escapes of its UTF-8 bytes. -pub(crate) fn string(text: &str) -> String { - let mut s = String::with_capacity(text.len() + 2); - s.push('('); - for b in text.bytes() { - match b { - b'(' | b')' | b'\\' => { - s.push('\\'); - s.push(char::from(b)); - } - 0x20..=0x7e => s.push(char::from(b)), - _ => { - let _ = write!(s, "\\{b:03o}"); - } - } - } - s.push(')'); - s -} - -/// `bytes` as a PostScript string: `(` `)` `\` escaped, carriage returns, line feeds and tabs as -/// `\r` `\n` `\t`, other bytes outside printable ASCII as octal escapes. -pub(crate) fn bytes(bytes: &[u8]) -> String { - let mut s = String::with_capacity(bytes.len() + 2); - s.push('('); - for &b in bytes { - match b { - b'(' | b')' | b'\\' => { - s.push('\\'); - s.push(char::from(b)); - } - b'\r' => s.push_str("\\r"), - b'\n' => s.push_str("\\n"), - b'\t' => s.push_str("\\t"), - 0x20..=0x7e => s.push(char::from(b)), - _ => { - let _ = write!(s, "\\{b:03o}"); - } - } - } - s.push(')'); - s -} - -/// A matrix operand `[a b c d e f]`. -pub(crate) fn matrix(a: Affine) -> String { - let mut s = String::from("["); - push_nums(&mut s, &a.as_coeffs()); - s.pop(); - s.push(']'); - s -} - -/// Append path `bp` (`m`, `l`, `c`, `h`; quadratics raised to cubics), one segment a line. +/// Append path `bp` using the short operators defined by our `VCdict` prolog. pub(crate) fn push_path(s: &mut String, bp: &BezPath) { - let mut last = kurbo::Point::ZERO; - let mut start = kurbo::Point::ZERO; - for el in bp.elements() { - match *el { - PathEl::MoveTo(p) => { - push_nums(s, &[p.x, p.y]); - s.push_str("m\n"); - (last, start) = (p, p); - } - PathEl::LineTo(p) => { - push_nums(s, &[p.x, p.y]); - s.push_str("l\n"); - last = p; - } - PathEl::QuadTo(a, p) => { - let c1 = last + (a - last) * (2.0 / 3.0); - let c2 = p + (a - p) * (2.0 / 3.0); - push_nums(s, &[c1.x, c1.y, c2.x, c2.y, p.x, p.y]); - s.push_str("c\n"); - last = p; - } - PathEl::CurveTo(a, b, p) => { - push_nums(s, &[a.x, a.y, b.x, b.y, p.x, p.y]); - s.push_str("c\n"); - last = p; - } - PathEl::ClosePath => { - s.push_str("h\n"); - last = start; - } - } - } + craft_ps::write::push_path(s, bp, craft_ps::write::PathOps::SHORT); } /// The fill operator for `rule`. @@ -197,25 +62,36 @@ pub(crate) fn ascii85_decode_within(text: &str, max: usize) -> Option> { /// Run-length encoding (PackBits: what PostScript's `RunLengthDecode` reads), shared with TIFF. pub(crate) use vectorcraft_render::encode::tiff::packbits; -/// `data` compressed for `FlateDecode` (zlib). -pub(crate) fn deflate(data: &[u8]) -> Vec { - let mut e = flate2::write::ZlibEncoder::new(Vec::with_capacity(data.len() / 2), flate2::Compression::default()); - // Writing to a Vec doesn't fail. - let _ = e.write_all(data); - e.finish().unwrap_or_default() -} - -/// zlib `data` inflated, when it is valid and at most `max` bytes. -pub(crate) fn inflate(data: &[u8], max: u64) -> Option> { - let mut out = vec![]; - flate2::read::ZlibDecoder::new(data).take(max + 1).read_to_end(&mut out).ok()?; - (out.len() as u64 <= max).then_some(out) -} - #[cfg(test)] mod tests { use super::{ascii85, ascii85_decode, num, push_num_places}; + #[test] + fn shared_writer_preserves_vcdict_path_and_operands() { + let mut path = vectorcraft_geom::BezPath::new(); + path.move_to((1.0, 2.0)); + path.line_to((3.0, 4.0)); + path.close_path(); + let mut output = String::new(); + super::push_path(&mut output, &path); + assert_eq!(output, "1 2 m\n3 4 l\nh\n"); + assert_eq!(super::matrix(vectorcraft_geom::Affine::IDENTITY), "[1 0 0 1 0 0]"); + assert_eq!(super::fill_op(vectorcraft_geom::FillRule::EvenOdd), "f*\n"); + assert_eq!(super::clip_op(vectorcraft_geom::FillRule::NonZero), "W\n"); + } + + #[test] + fn shared_writer_keeps_large_integer_zeroes_and_bounded_flate() { + let mut output = String::new(); + push_num_places(&mut output, 1e15, 0); + assert_eq!(output, "1000000000000000"); + let packed = super::deflate(b"EPS payload"); + assert_eq!(super::inflate(&packed, 11).as_deref(), Some(&b"EPS payload"[..])); + assert!(super::inflate(&packed, 10).is_none()); + assert_eq!(super::inflate(&packed, u64::MAX).as_deref(), Some(&b"EPS payload"[..])); + assert!(super::inflate(&packed[..packed.len() - 1], 11).is_none()); + } + #[test] fn ascii85_first_line_never_starts_with_percent() { let data = [0x0C, 0x80, 0, 0, 1, 2, 3, 4]; From ebf49351e6f08b0523faca8523ec0f34873c53e7 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 07:15:30 -0500 Subject: [PATCH 2/5] build(eps): pin merged shared PostScript writer --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34bcd903ce..8cf38fc577 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1137,7 +1137,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=9c8839ce57190653d28bcea1fe2f217ff970b11b#9c8839ce57190653d28bcea1fe2f217ff970b11b" +source = "git+https://github.com/storytold/craft-libs?rev=a80c0f25f1c4767374a27a444fbf95e3e8162e14#a80c0f25f1c4767374a27a444fbf95e3e8162e14" dependencies = [ "flate2", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index 858fa5ab71..4de672793f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "9c8839ce57190653d28bcea1fe2f217ff970b11b", default-features = false, features = ["write"] } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "a80c0f25f1c4767374a27a444fbf95e3e8162e14", default-features = false, features = ["write"] } craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "e2dc681a3" } craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "e98299546f5c5c3c22388d16507f8b5e61a5f280", features = ["egui"] } # internal From ae864894069c9d46440355698a732aa8c7ffd3dd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 10:08:08 -0500 Subject: [PATCH 3/5] render: delegate TIFF and EPS PackBits encoding to craft-stream-codecs --- Cargo.lock | 14 +++++++++++--- Cargo.toml | 2 +- crates/render/src/encode/tests_tiff.rs | 13 +++++++++++++ crates/render/src/encode/tiff.rs | 25 +------------------------ 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 783e02a9bc..d4338ac63f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1253,11 +1253,11 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "fax", "hayro-ccitt", - "hayro-jbig2", + "hayro-jbig2 0.3.0 (git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375)", "thiserror 2.0.21", ] @@ -2540,6 +2540,14 @@ dependencies = [ "hayro-ccitt", ] +[[package]] +name = "hayro-jbig2" +version = "0.3.0" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +dependencies = [ + "hayro-ccitt", +] + [[package]] name = "hayro-jpeg2000" version = "0.3.5" @@ -2561,7 +2569,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc6 dependencies = [ "flate2", "hayro-ccitt", - "hayro-jbig2", + "hayro-jbig2 0.3.0 (git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd)", "hayro-jpeg2000", "memchr", "rustc-hash 2.1.3", diff --git a/Cargo.toml b/Cargo.toml index 89d6328ea7..ae7835b750 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd", features = ["egui"] } # internal diff --git a/crates/render/src/encode/tests_tiff.rs b/crates/render/src/encode/tests_tiff.rs index 392e4ed6d2..17dea965a0 100644 --- a/crates/render/src/encode/tests_tiff.rs +++ b/crates/render/src/encode/tests_tiff.rs @@ -232,3 +232,16 @@ fn lzw_strips_read_back_as_weezl_reads_them() { assert!(same >= weezl.len().min(4_300), "{} bytes: the same for {same}", strip.len()); } } + +#[test] +fn shared_packbits_preserves_packet_bytes_and_append_contract() { + let mut out = vec![42]; + t::packbits(b"aabbccc", &mut out); + assert_eq!(out, [42, 3, b'a', b'a', b'b', b'b', 254, b'c']); + let before = out.clone(); + t::packbits(&[], &mut out); + assert_eq!(out, before); + let mut run = vec![]; + t::packbits(&[7; 129], &mut run); + assert_eq!(run, [129, 7, 0, 7]); +} diff --git a/crates/render/src/encode/tiff.rs b/crates/render/src/encode/tiff.rs index 6a01f78109..8be67aca20 100644 --- a/crates/render/src/encode/tiff.rs +++ b/crates/render/src/encode/tiff.rs @@ -282,30 +282,7 @@ fn resolution(ppi: f64) -> Values { /// `data` run-length encoded (PackBits: what TIFF's compression 32773 and PostScript's /// `RunLengthDecode` read), without an end marker. pub fn packbits(data: &[u8], out: &mut Vec) { - let mut i = 0; - while i < data.len() { - let Some(&b) = data.get(i) else { break }; - let run = data.get(i..).map_or(1, |rest| rest.iter().take(128).take_while(|x| **x == b).count()); - if run >= 3 { - out.push((257 - run) as u8); - out.push(b); - i += run; - continue; - } - // Literal bytes up to the next run of three. - let mut j = i; - while j < data.len() && j - i < 128 { - let three = data.get(j..j + 3).is_some_and(|w| w[0] == w[1] && w[1] == w[2]); - if three { - break; - } - j += 1; - } - let j = j.max(i + 1).min(data.len()); - out.push((j - i - 1) as u8); - out.extend(data.get(i..j).unwrap_or_default()); - i = j; - } + craft_stream_codecs::runlength::encode_packbits_into(data, out); } /// The TIFF options of a raster export. From aa5d0424412229046c174b7b47a404dea087a805 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 11:25:29 -0500 Subject: [PATCH 4/5] deps: synchronize PDF backend pins with shared stream codecs --- Cargo.lock | 28 ++++++++++------------------ Cargo.toml | 16 ++++++++-------- xtask/src/pdf_deps.rs | 2 +- 3 files changed, 19 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4338ac63f..784f78a494 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1206,7 +1206,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1257,7 +1257,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4 dependencies = [ "fax", "hayro-ccitt", - "hayro-jbig2 0.3.0 (git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375)", + "hayro-jbig2", "thiserror 2.0.21", ] @@ -2507,7 +2507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "brotli", "hayro-postscript", @@ -2516,7 +2516,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -2531,20 +2531,12 @@ dependencies = [ "yoke", ] -[[package]] -name = "hayro-jbig2" -version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" -dependencies = [ - "fearless_simd", - "hayro-ccitt", -] - [[package]] name = "hayro-jbig2" version = "0.3.0" source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ + "fearless_simd", "hayro-ccitt", ] @@ -2560,16 +2552,16 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "flate2", "hayro-ccitt", - "hayro-jbig2 0.3.0 (git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd)", + "hayro-jbig2", "hayro-jpeg2000", "memchr", "rustc-hash 2.1.3", @@ -3365,7 +3357,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "base64 0.22.1", "bumpalo", @@ -3474,7 +3466,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=a499742a9389f47d10cdc61e4cdbf4e5f07f48cd#a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" +source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index ae7835b750..c38fccbb8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd", default-features = false, features = ["interpret", "write"] } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd", features = ["serde"] } @@ -181,13 +181,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index 02216d18f2..bfa5f17452 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd"; +const REV: &str = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV), From ca7ad8db030b3b12a1fcdb04bf5e143abd036aab Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 16 Nov 2026 16:04:48 -0500 Subject: [PATCH 5/5] fix(deps): pin PackBits and PDF cohort to merged shared revision --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 18 +++++++++--------- xtask/src/pdf_deps.rs | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 784f78a494..0b19bf0be7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1206,7 +1206,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1253,7 +1253,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "fax", "hayro-ccitt", @@ -2507,7 +2507,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "brotli", "hayro-postscript", @@ -2516,7 +2516,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -2534,7 +2534,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -2552,12 +2552,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "flate2", "hayro-ccitt", @@ -3357,7 +3357,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "base64 0.22.1", "bumpalo", @@ -3466,7 +3466,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375#ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" +source = "git+https://github.com/storytold/craft-libs?rev=0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e#0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index c38fccbb8e..21ec59b66f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375", default-features = false, features = ["interpret", "write"] } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e", default-features = false, features = ["interpret", "write"] } craft-print = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-ui = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd", features = ["serde"] } @@ -39,7 +39,7 @@ craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "a craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd" } craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "a499742a9389f47d10cdc61e4cdbf4e5f07f48cd", features = ["egui"] } # internal @@ -181,13 +181,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" } diff --git a/xtask/src/pdf_deps.rs b/xtask/src/pdf_deps.rs index bfa5f17452..1f42f2f72a 100644 --- a/xtask/src/pdf_deps.rs +++ b/xtask/src/pdf_deps.rs @@ -5,7 +5,7 @@ use std::process::Command; use serde_json::Value; -const REV: &str = "ed850ede0f26ef0b8ff9b4d1fc08466a1cf21375"; +const REV: &str = "0cca4ac66f9f4576b3acc5f84d7a2a2ae9fb943e"; const PACKAGES: &[(&str, &str, &str)] = &[ ("craft-pdf", "0.1.0", REV), ("krilla", "0.8.2", REV),