DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge branch 'print-color' into print-color-x1a
aiongg0409bbf9aae1
diff --cc Cargo.lockindex 61b84b72d,701ff7efb..da8c59928--- a/Cargo.lock+++ b/Cargo.lock@@@ -995,9 -980,9 +1004,9 @@@ dependencies =[[package]]name = "designcraft-color"- version = "0.9.0"+ version = "0.12.0"dependencies = [- "craft-cms",+ "craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e9546e191dd62f2bc1d61eca45dbdc2f1b3c1d8e)","kurbo","proptest","serde",@@@ -1140,9 -1127,9 +1151,9 @@@ dependencies =[[package]]name = "designcraft-images"- version = "0.9.0"+ version = "0.12.0"dependencies = [- "craft-cms",+ "craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e9546e191dd62f2bc1d61eca45dbdc2f1b3c1d8e)","designcraft-color","designcraft-fonts","image",@@@ -1168,11 -1155,11 +1179,12 @@@ dependencies =[[package]]name = "designcraft-pdf"- version = "0.9.0"+ version = "0.12.0"dependencies = [+ "chrono",- "craft-cms",+ "craft-cms 0.1.0 (git+https://github.com/storytold/craft-libs?rev=e9546e191dd62f2bc1d61eca45dbdc2f1b3c1d8e)","craft-pdf",+ "craft-prepress","designcraft-color","designcraft-compose","designcraft-doc",diff --cc Cargo.tomlindex c50b2dc1b,82e895afa..3c8b1e6ed--- a/Cargo.toml+++ b/Cargo.toml@@@ -11,10 -11,10 +11,10 @@@ rust-version = "1.95repository = "https://github.com/storytold/designcraft"[workspace.dependencies]- # Shared writer; the immutable revision must be published before this consumer.+ # Shared reader and writer; publish the immutable revision before this consumer.-craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.1.0", default-features = false }+craft-pdf = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.1.0", default-features = false }# Separations, ink coverage and the ink manager; same revision as craft-pdf and the krilla patch.-craft-prepress = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.1.0" }+craft-prepress = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.1.0", features = ["flatten"] }# internaldesigncraft-geom = { path = "crates/geom" }designcraft-color = { path = "crates/color" }@@@ -118,11 -124,9 +124,11 @@@ debug =# Opt-in cancelable macOS termination on the pinned winit 0.30 line.[patch.crates-io]- winit = { git = "https://github.com/skylartaylor/winit.git", rev = "3d51077fd1a966f84df9ef287839dc84fd5b4ca7" }-krilla = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.8.2" }+krilla = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.8.2" }+ winit = { git = "https://github.com/storytold/winit.git", rev = "3d51077fd1a966f84df9ef287839dc84fd5b4ca7" }-hayro = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.7.1" }-hayro-interpret = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.7.0" }-hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.7.2" }-hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "8fbfea8840f0a0f5a22df18901e9db324894b2ce", version = "=0.3.0" }+# The hayro crates from craft-libs' vendor/ directory (pdfcraft's patches plus craft-libs'; see its+# vendor/README.craft-reader.md), at the craft-pdf revision.- hayro = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4" }- hayro-interpret = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4" }- hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4" }- hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4" }++hayro = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.7.1" }++hayro-interpret = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.7.0" }++hayro-syntax = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.7.2" }++hayro-jbig2 = { git = "https://github.com/aiongg/craft-libs", rev = "d30598dcb4b389561c485b97d4a97a0c86bc36e4", version = "=0.3.0" }diff --cc ROADMAP.mdindex 82da9fd22,f8a16ce13..5dbc9326a--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -348,9 -348,20 +348,21 @@@ 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-color stops export as before. No readiness percentage change.+ - **2026-10-16** · Edit › Keyboard Shortcuts imports a set saved by InDesign's Show Set (.txt, Windows or Mac key names, UTF-8 or UTF-16): matched commands take its Default shortcuts or lose theirs, other commands give up keys it takes, and a report lists what it changed and the items it could not match (`window.importShortcuts`, #1180). Tool keys stay fixed. No readiness percentage change.+ - **2026-10-22** · A ruler guide dragged with the Selection tools, out of a ruler, on its own or with other selected guides, snaps along its axis as objects do (#1221): to other ruler guides, margins, columns, bleed, page and object edges and centers (with the smart-guide mark) and the document grid, within the snap zone and following Snap to Guides and Smart Guides. Shift snaps to the ruler's ticks and Cmd suspends snapping. The preview line, the position readout and the drop use the same snapped position. No readiness percentage change.+ - **2026-10-22** · macOS: the app menu has a Language submenu after Settings… with each interface language in its own name and the current one checked, as in the suite's other apps; Preferences › General › Interface Language stays. No readiness percentage change.+ - **2026-10-22** · macOS menu bar: the menus keep working after the interface language or Show CJK Features changes (a rebuilt menu bar lost every click, Quit included), and its key equivalents are the shortcuts in effect, so a shortcut moved in the Keyboard Shortcuts editor leaves its old menu item. No readiness percentage change.+ - **2026-10-22** · Paragraph rules: Rule Above's offset is measured from the first line's baseline to the rule's bottom edge, as in InDesign. Rules sat one ascent too high and crossed the previous paragraph's text (reported from an imported INDD document). No readiness percentage change.+ - **2026-10-21** · Ruler guides are selected like objects (#1282): a click with the Selection tools selects a guide (also where it crosses an object), Shift-click adds or removes one, a new guide from the rulers is selected, a marquee that touches no object selects the guides it crosses, and Edit › Select All Guides (⌥⌘G, `guide.selectAll`) selects every unlocked guide on the spread. Selected guides draw thicker in their layer's color, drag together (all of them shown moving), nudge with the arrow keys and go with Delete, each as one undo step (`guide.select`, `guide.deselect`, `guide.moveBy`, `guide.delete {}`). With one guide selected the Control bar's X (vertical guide) or Y (horizontal guide) field and Properties › Transform show where it is, as the rulers measure, and typing a value moves it there. No readiness percentage change.+ - **2026-10-16** · Selection: drag a column guide to move its gutter, as in InDesign (#1096). Both guides of the gutter move together and keep its width, stop at the neighbouring guides and the margins, and snap to the document grid, guides and objects, or with Shift to the ruler's tick marks; Escape cancels and the drag is one undo step. Locked column guides (the default) are not picked. A document page takes the result as its own columns; on a parent page it passes to the pages that follow it. `layout.moveColumnGuide` does the same over the control channel and MCP. No readiness percentage change.+ - **2026-10-16** · Layout: autoflow, inserted pages and new parents follow dragged column guides (#1096). Autoflow sets one frame per dragged column and counts the pages it adds from them; Insert Pages and New Parent keep the custom positions with the column count and gutter; a page that moves to the other side of the spine (inserted, deleted or moved pages, Duplicate Spread, a new parent's other page) has them mirrored across its margin box, as InDesign does; `document.inspect` reports each page's gutter, column rects and whether its columns are custom. No readiness percentage change.+ - **2026-10-16** · Layout: Margins and Columns keeps dragged column guides unless the column count or gutter changes (#1096). The dialog sends every field on OK, so a margin-only change re-divided the columns evenly. Margin changes keep the positions; the columns follow them only while they fit the margin box. No readiness percentage change.+ - **2026-10-16** · Lock Guides and Lock Column Guides are commands in View ▸ Grids & Guides (`view.lockGuides`, ⌥⌘;, and `view.lockColumnGuides`), so the control channel and MCP reach them. Lock Column Guides is an undo step, is saved with the document, on in new ones, and read from and written to IDML's `ColumnGuideLocked`, which export always wrote as locked (#1096). No readiness percentage change.+ - **2026-10-16** · IDML: a page keeps column guides that were dragged off centre (InDesign's Custom columns). They were divided evenly on import, so the gutter sprang back to the middle; the imported positions now place the columns, with the canvas guides, snapping and text placement following them, and they are written back on export. Layout › Margins and Columns re-divides them evenly when the count or gutter changes, as InDesign's does. No readiness percentage change.+ - **2026-10-16** · IDML: custom column positions are checked before they are used (#1096). A set must give two edges per column, ascending from the left margin to the right one; any other (a wrong count, unsorted or non-numeric values, a list longer than 216 columns allow, or positions left behind by a margin or page-size change) is the even split, in the canvas, on import and on export, instead of columns drawn outside the margins. No readiness percentage change.- **2026-10-16** · Type › Reload Fonts (`font.reload`): fonts installed, edited or removed while DesignCraft runs are read again without a restart, and the open documents recompose with them (#328, #547). An edited font file is noticed by its length and modification time; bundled, added and document fonts stay as they are. InDesign does this by itself, so noticing changes automatically is still open (gap 6). No readiness percentage change.- **2026-10-16** · Parents can be deleted from their Pages-panel context menu or `layout.parents.delete {id}`. Applied-page and based-on references are cleared, local override copies survive, and Undo restores the parent. Addresses the deletion portion of #956; no readiness percentage change.- **2026-10-17** · File › Package writes the document's and the IDML's links relative to the package (`Links/logo.png`, `file:Links/logo.png`), so a package holds no path from the machine that made it; opening a document resolves them to the files beside it. Links › Copy Link(s) To still links by full path. (#340). No readiness percentage change.diff --cc crates/engine/src/cmd/export.rsindex 9655432ad,e96229a4c..c9e847ccd--- a/crates/engine/src/cmd/export.rs+++ b/crates/engine/src/cmd/export.rs@@@ -820,20 -734,12 +821,20 @@@ pub(crate) fn pdf_export(s: &Session, pv.as_f64().filter(|v| (36.0..=1200.0).contains(v)).ok_or_else(|| bad("file.exportPdf", "`flatten`: high|medium|low or 36–1200 ppi"))?,),};- let flattened = ppi.map(|ppi| flatten(&st.doc, &s.cache, ppi));+ // PDF/X-1a: craft-prepress flattens the PDF in its inks; `flatten` sets its resolution.+ let x1a = opts.standard == Standard::PdfX1a;+ let mut opts = opts;+ 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)) };// Placed PDFs with hidden layers go out as images showing just their visible layers.let base: &designcraft_doc::Document = flattened.as_ref().map_or(&st.doc, |f| &f.0);- let (layered, layer_count) = rasterize_layered(base);+ let (layered, layer_count) = rasterize_layered(base)?;let base2: &designcraft_doc::Document = layered.as_ref().unwrap_or(base);- let (fx_doc, fx_count) = rasterize_effects(base2, &s.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);+ opts.shadows = std::sync::Arc::new(shadows);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;diff --cc crates/ui-egui/src/i18n.rsindex b5e9d89ad,6057abc97..905b7d862--- a/crates/ui-egui/src/i18n.rs+++ b/crates/ui-egui/src/i18n.rs@@@ -5006,6 -4900,6 +4905,7 @@@ mod tests"No model credits were built into this copy.","Object Style","Paragraph Style",++ "PDF/X-1a:2003","Press keys…","Range:","Redefine Document Style",@@@ -5014,6 -4909,6 +4915,7 @@@"Story {story} ← story {parent}","Story Editor — {count} words","Text Anchor",++ "Transparency Flattener","Use Document Style Definition",// Status-bar messages."Alternate layout",diff --cc xtask/src/pdf_deps.rsindex 34868f407,67119b9af..6c9c4cffe--- a/xtask/src/pdf_deps.rs+++ b/xtask/src/pdf_deps.rs@@@ -5,8 -5,15 +5,15 @@@ use std::process::Commanduse serde_json::Value;const REPO: &str = "https://github.com/aiongg/craft-libs";-const REV: &str = "8fbfea8840f0a0f5a22df18901e9db324894b2ce";+const REV: &str = "d30598dcb4b389561c485b97d4a97a0c86bc36e4";- const PACKAGES: &[(&str, &str)] = &[("craft-pdf", "0.1.0"), ("krilla", "0.8.2")];+ const PACKAGES: &[(&str, &str)] = &[+ ("craft-pdf", "0.1.0"),+ ("krilla", "0.8.2"),+ ("hayro", "0.7.1"),+ ("hayro-interpret", "0.7.0"),+ ("hayro-syntax", "0.7.2"),+ ("hayro-jbig2", "0.3.0"),+ ];pub fn run(root: &Path) -> Result<(), String> {let output = Command::new(std::env::var_os("CARGO").unwrap_or_else(|| "cargo".into()))