DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge remote-tracking branch 'upstream/main' into print-color-separations
aiongg2e6df922c8ce
diff --cc ROADMAP.mdindex 8040edc69,68f23b064..003f2b0ff--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -380,9 -381,8 +380,10 @@@ list) · [roadmap.md](docs/roadmap.md)Newest first.+ - **2026-10-20** · PDF/X-1a:2003 export (craft-libs#194): `file.exportPdf {standard: "x1a"}`, the Export PDF dialog's PDF/X-1a:2003 preset and standard. The PDF/X-4 print file is flattened in its inks by craft-prepress (no transparency; spot, process, overprint and live text kept; complex regions as DeviceN images at the Transparency Flattener preset's resolution), then written as PDF 1.4 with the X-1a identification and checked; `validate-pdf --standard x1a`. Soft drop shadows reach the flattener in their swatch's inks; other soft effects are still RGB images. No readiness percentage change.- **2026-10-20** · Print color (craft-libs#190): CMYK print PDFs blend in DeviceCMYK through craft-pdf's print settings instead of byte rewrites, with the CMYK working space as the output intent in PDF/X-4 only; overprint (Overprint Fill, Stroke and Gap, overprinting text, 100% [Black]) is written as `/op` `/OP` `/OPM 1`; Knockout Group writes `/K true` instead of becoming an image; File › Print prints the PDF Export PDF writes. No readiness percentage change.+- **2026-10-20** · Spot gradients print on their plates. A gradient stop keeps the swatch it was given (Gradient panel drop, `swatch.create {gradient}`, `object.gradient`, IDML `StopColor`), following its renames and edits. PDF export shades one spot with its tints or [Paper] as a Separation, and a spot with process inks or a second spot as DeviceN; a process gradient to [Paper] prints in DeviceCMYK. Documents with plain-colour stops export as before. No readiness percentage change.+- **2026-10-20** · Separations Preview shows the plates the exported PDF prints, spot plates included: each visible spread is exported in memory with the Export PDF settings and separated by craft-prepress off the UI thread, then shown as all inks, one plate or an ink limit. The Ink Manager builds craft-prepress's `InkSet` from the document for export and preview. On the sample magazine the first preview of a spread takes about 0.6–1.1 s, most of it the PDF export. No readiness percentage change.- **2026-10-20** · Spot gradients print on their plates. A gradient stop keeps the swatch it was given (Gradient panel drop, `swatch.create {gradient}`, `object.gradient`, IDML `StopColor`), following its renames and edits. PDF export shades one spot with its tints or [Paper] as a Separation, and a spot with process inks or a second spot as DeviceN; a process gradient to [Paper] prints in DeviceCMYK. Documents with plain-color stops export as before. No readiness percentage change.- **2026-10-24** · Panels dock through the suite's shared docking (craft-libs), and on desktop a floating panel opens in its own window that can leave the main window: keys pressed there run the main window's shortcuts, clipboard and tool keys, and the canvas paints no tool cursor while another of the app's windows has the pointer. The web build keeps floating panels in the page. No readiness percentage change.- **2026-10-24** · Story Options rejects malformed or nonexistent explicit story/frame IDs without changing the selected story, including an invalid frame alongside a valid story. Null targets remain absent; omitted targets still use the selection. No readiness percentage change.diff --cc crates/engine/src/cmd/export.rsindex f22607c29,3b7dd48d1..8de9ec1be--- a/crates/engine/src/cmd/export.rs+++ b/crates/engine/src/cmd/export.rs@@@ -803,25 -907,23 +902,34 @@@ pub(crate) fn flatten_ppi(id: &str, p:Some(Value::String(s)) if s == "medium" => Some(150.0),Some(Value::String(s)) if s == "low" => Some(72.0),Some(Value::Bool(true)) => Some(300.0),- Some(v) => Some(- v.as_f64().filter(|v| (36.0..=1200.0).contains(v)).ok_or_else(|| bad("file.exportPdf", "`flatten`: high|medium|low or 36–1200 ppi"))?,- ),- };- // PDF/X-1a: craft-prepress flattens the PDF in its inks; `flatten` sets its resolution.+ Some(v) => Some(v.as_f64().filter(|v| (36.0..=1200.0).contains(v)).ok_or_else(|| bad(id, "`flatten`: high|medium|low or 36–1200 ppi"))?),+ })+}++/// The print PDF of `opts`' pages: the transparency flattener at `ppi` (if any), placed PDFs+/// with hidden layers and soft effects as images, the PDF boxes of placed graphics, the PDF+/// itself and its transparency blend space. Export PDF and File › Print add their view options+/// to it ([`pdf_export`]); Separations Preview separates it as it is.+pub(crate) fn print_pdf(+ d: &designcraft_doc::Document,+ cache: &designcraft_compose::Cache,+ opts: &PdfOptions,+ ppi: Option<f64>,+) -> Result<designcraft_pdf::ExportReport> {- let flattened = ppi.map(|ppi| flatten(d, cache, ppi));++ // PDF/X-1a: craft-prepress flattens the PDF in its inks; `ppi` sets its resolution.+ let x1a = opts.standard == Standard::PdfX1a;- let mut opts = opts;++ let mut opts = opts.clone();+ if x1a {+ opts.flatten_dpi = ppi.unwrap_or(300.0) as f32;+ }- let flattened = if x1a { None } else { ppi.map(|ppi| flatten(&st.doc, &s.cache, ppi)) };- let base: &designcraft_doc::Document = flattened.as_ref().map_or(&st.doc, |f| &f.0);++ let flattened = if x1a { None } else { ppi.map(|ppi| flatten(d, cache, ppi)) };+ let base: &designcraft_doc::Document = flattened.as_ref().map_or(d, |f| &f.0);let (layered, layer_count) = if opts.standard == Standard::PdfA2b { rasterize_layered(base)? } else { (None, 0) };let base2: &designcraft_doc::Document = layered.as_ref().unwrap_or(base);- let (fx_doc, fx_count) = rasterize_effects(base2, cache);- let shadows = if x1a { shadow_masks(base2, &s.cache, f64::from(opts.flatten_dpi)) } else { Default::default() };- let (fx_doc, fx_count) = rasterize_effects(base2, &s.cache, &shadows);++ let shadows = if x1a { shadow_masks(base2, cache, f64::from(opts.flatten_dpi)) } else { Default::default() };++ let (fx_doc, fx_count) = rasterize_effects(base2, cache, &shadows);+ opts.shadows = std::sync::Arc::new(shadows);++ let opts = &opts;let doc: &designcraft_doc::Document = fx_doc.as_ref().unwrap_or(base2);let boxed = super::interchange::with_pdf_boxes(doc);let doc: &designcraft_doc::Document = &boxed;