DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
Merge remote-tracking branch 'origin/main' into paragraph-shading-indesign
moppeeer52c6ac3bf672
diff --cc ROADMAP.mdindex ebfbbcc26,153555913..f1c7be6dd--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -348,8 -358,11 +358,12 @@@ list) · [roadmap.md](docs/roadmap.md)Newest first.+- **2026-10-22** · Paragraph Style Options › Paragraph Shading and Paragraph Border are laid out as InDesign's: headed with the page's name; Tint is a spinner with InDesign's presets and has Overprint beside it (shading, border and gap; a new attribute each, kept through IDML; PDF export warns it doesn't overprint yet); Corner Size and Shape is InDesign's two-by-two grid of corner icons, sizes and shape menus showing each shape's glyph, with the link in the middle; offsets and weights have spinners. Found in the Learn Skills Daily course, chapter 41. No readiness percentage change.+ - **2026-10-24** · Custom-positioned anchored objects honour Relative to Spine (`anchored.options {spineRelative}`, IDML `SpineRelative`): the settings describe a left-hand page and mirror on a right-hand page, so marginal notes stay in the outside margin on both pages of a spread. On right-hand pages they took the left-hand placement and landed in the inside margin, across the spine or over the body text. No readiness percentage change.+ - **2026-10-23** · Save and export dialogs (Save As, Save a Copy, Export PDF and the other exports, Package, libraries and books) start in the active document's folder once it has been saved, and for a document never saved in the folder of the last file saved or exported, remembered across sessions (#1653). A folder deleted since falls back to the system's choice. No readiness percentage change.+ - **2026-10-22** · Autoflow (Shift-click with the loaded text cursor, autoflow on Place, `text.thread {autoflow}`) fills the pages that follow before it adds any, as InDesign does: one frame per column on each following page, whatever else the page holds, then new pages at the end of the document. It inserted pages right after the story's last frame, in front of the document's own pages. Frames it set past the end of the text go again; a page the document had stays, and a page autoflow added only for such a frame goes with it. Smart Text Reflow of the primary text frame is unchanged. 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-23** · Translations: a missing string shows in English and fails no test; `cargo xtask i18n-report`, run by `cargo xtask ci`, prints the missing strings per language. Tests keep duplicate-key and placeholder checks and the language mechanics (lookup, context captions, plural captions, right-to-left). 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.diff --cc crates/compose/src/parabox.rsindex 314679d51,f6b90e127..09c5b19e8--- a/crates/compose/src/parabox.rs+++ b/crates/compose/src/parabox.rs@@@ -128,6 -122,45 +128,44 @@@ pub(crate) fn draw(out: &mut ComposedSt}}+ /// The shading box for one part of a paragraph run, if it has any area.+ fn shading_deco(s: &Shading, part: &Part<'_>, frames: &[FrameSpec], first_part: bool, last_part: bool) -> Option<Deco> {+ let r = inner_rect(&part.lines, s.width, s.top, s.bottom)?;+ let [t, l, bo, rr] = s.offsets;+ let mut rect = Rect::new(r.x0 - l, r.y0 - t, r.x1 + rr, r.y1 + bo);+ if s.clip+ && let Some(f) = frames.get(part.fi)+ {+ rect = rect.intersect(frame_rect(f));+ }+ if rect.width() > 0.0 && rect.height() > 0.0 {+ // Corners stay square where the box is cut by a split.+ let corners = cut_corners(s.corners, !first_part, !last_part);+ let path = (!corners.iter().all(Corner::is_none)).then(|| box_outline(rect, &corners, [true; 4]));- return Some(Deco { rect, color: s.color.clone(), tint: s.tint, path, nonprinting: s.nonprinting });++ return Some(Deco { rect, color: s.color.clone(), tint: s.tint, path, nonprinting: s.nonprinting, overprint: s.overprint });+ }+ None+ }++ /// The border strokes (and plain edges) for one part of a paragraph run, pushed onto `decos`.+ fn border_decos(bd: &Border, part: &Part<'_>, first_part: bool, last_part: bool, decos: &mut Vec<(usize, bool, Deco)>) {+ let Some(r) = inner_rect(&part.lines, bd.width, bd.top, bd.bottom) else { return };+ let [t, l, bo, rr] = bd.offsets;+ let o = Rect::new(r.x0 - l, r.y0 - t, r.x1 + rr, r.y1 + bo);+ let open_top = !first_part && !bd.display_if_splits;+ let open_bottom = !last_part && !bd.display_if_splits;+ for (path, gap) in border_paths(bd, o, open_top, open_bottom) {- let (color, tint) = if gap { (bd.gap_color.clone(), bd.gap_tint) } else { (bd.color.clone(), bd.tint) };- decos.push((part.fi, false, Deco { rect: path.bounding_box(), color, tint, path: Some(path), nonprinting: false }));++ let (color, tint, overprint) =++ if gap { (bd.gap_color.clone(), bd.gap_tint, bd.gap_overprint) } else { (bd.color.clone(), bd.tint, bd.overprint) };++ decos.push((part.fi, false, Deco { rect: path.bounding_box(), color, tint, path: Some(path), nonprinting: false, overprint }));+ }+ if is_plain(bd, open_top, open_bottom) {- decos.extend(- plain_edges(bd, o, open_top, open_bottom)- .into_iter()- .map(|rect| (part.fi, false, Deco { rect, color: bd.color.clone(), tint: bd.tint, path: None, nonprinting: false })),- );++ decos.extend(plain_edges(bd, o, open_top, open_bottom).into_iter().map(|rect| {++ (part.fi, false, Deco { rect, color: bd.color.clone(), tint: bd.tint, path: None, nonprinting: false, overprint: bd.overprint })++ }));+ }+ }+/// The decorations of paragraphs `paras` sharing box `b`: (frame, drawn under the rest, deco).fn group_decos(out: &ComposedStory, paras: std::ops::RangeInclusive<usize>, b: &ParaBox, frames: &[FrameSpec]) -> Vec<(usize, bool, Deco)> {let mut parts: Vec<Part<'_>> = Vec::new();